Skip to content

Commit

Permalink
feat: support trash and computer scheme
Browse files Browse the repository at this point in the history
Forward scheme handler of trash and computer to inode/directory's
handler.

Log: support trash and computer scheme
Issue: linuxdeepin/developer-center#8266
  • Loading branch information
asterwyx committed Apr 26, 2024
1 parent f04cffa commit 22769d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dde-open/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ func openFile(filename string) error {
func openScheme(scheme, url string) error {
logger.Debugf("openScheme: %q, %q", scheme, url)
appInfo := gio.AppInfoGetDefaultForUriScheme(scheme)
if appInfo == nil && (scheme == "trash" || scheme == "computer") {
// As file manager do not register scheme for trash and computer, which are the private protocols
// supported by gio. To keep compatibility, we forward these protocols to inode/directory's handler.
// By default, it will be the default file manager like dde-file-manager.
appInfo = gio.AppInfoGetDefaultForType("inode/directory", true)
}
if appInfo == nil {
return errors.New("failed to get appInfo")
}
Expand Down

0 comments on commit 22769d7

Please sign in to comment.