Skip to content

Commit 95c2fd8

Browse files
asterwyxdeepin-bot[bot]
authored andcommitted
feat: support trash and computer scheme
Forward scheme handler of trash and computer to inode/directory's handler. Log: support trash and computer scheme Issue: linuxdeepin/developer-center#8266
1 parent f04cffa commit 95c2fd8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

dde-open/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ func openFile(filename string) error {
204204
func openScheme(scheme, url string) error {
205205
logger.Debugf("openScheme: %q, %q", scheme, url)
206206
appInfo := gio.AppInfoGetDefaultForUriScheme(scheme)
207+
if appInfo == nil && (scheme == "trash" || scheme == "computer") {
208+
// As file manager do not register scheme for trash and computer, which are the private protocols
209+
// supported by gio. To keep compatibility, we forward these protocols to inode/directory's handler.
210+
// By default, it will be the default file manager like dde-file-manager.
211+
appInfo = gio.AppInfoGetDefaultForType("inode/directory", true)
212+
}
207213
if appInfo == nil {
208214
return errors.New("failed to get appInfo")
209215
}

0 commit comments

Comments
 (0)