Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support trash and computer scheme #116

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading