Skip to content

Commit

Permalink
locations: Quote URIs when opening a location
Browse files Browse the repository at this point in the history
If the URI has spaces in it, you need quoting to pass it correctly
to 'gio open'.
  • Loading branch information
philipl committed Apr 26, 2018
1 parent e102e5a commit 12fa1cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ var Removables = new Lang.Class({
volumeKeys.set_string('Desktop Entry', 'Name', volume.get_name());
volumeKeys.set_string('Desktop Entry', 'Icon', this._getWorkingIconName(volume.get_icon()));
volumeKeys.set_string('Desktop Entry', 'Type', 'Application');
volumeKeys.set_string('Desktop Entry', 'Exec', 'nautilus ' + uri);
volumeKeys.set_string('Desktop Entry', 'Exec', 'nautilus "' + uri + '"');
volumeKeys.set_string('Desktop Entry', 'StartupNotify', 'true');
volumeKeys.set_string('Desktop Entry', 'Actions', 'mount;');
volumeKeys.set_string('Desktop Action mount', 'Name', __('Mount'));
volumeKeys.set_string('Desktop Action mount', 'Exec', 'gio mount ' + uri);
volumeKeys.set_string('Desktop Action mount', 'Exec', 'gio mount "' + uri + '"');
let volumeAppInfo = Gio.DesktopAppInfo.new_from_keyfile(volumeKeys);
let volumeApp = new Shell.App({appInfo: volumeAppInfo});
this._volumeApps.push(volumeApp);
Expand Down Expand Up @@ -204,19 +204,19 @@ var Removables = new Lang.Class({
mountKeys.set_string('Desktop Entry', 'Icon',
this._getWorkingIconName(volume.get_icon()));
mountKeys.set_string('Desktop Entry', 'Type', 'Application');
mountKeys.set_string('Desktop Entry', 'Exec', 'gio open ' + uri);
mountKeys.set_string('Desktop Entry', 'Exec', 'gio open "' + uri + '"');
mountKeys.set_string('Desktop Entry', 'StartupNotify', 'true');
mountKeys.set_string('Desktop Entry', 'XdtdUri', escapedUri);
mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;');
if (mount.can_eject()) {
mountKeys.set_string('Desktop Action unmount', 'Name', __('Eject'));
mountKeys.set_string('Desktop Action unmount', 'Exec',
'gio mount -e ' + uri);
'gio mount -e "' + uri + '"');
} else {
mountKeys.set_string('Desktop Entry', 'Actions', 'unmount;');
mountKeys.set_string('Desktop Action unmount', 'Name', __('Unmount'));
mountKeys.set_string('Desktop Action unmount', 'Exec',
'gio mount -u ' + uri);
'gio mount -u "' + uri + '"');
}
let mountAppInfo = Gio.DesktopAppInfo.new_from_keyfile(mountKeys);
let mountApp = new Shell.App({appInfo: mountAppInfo});
Expand Down

0 comments on commit 12fa1cb

Please sign in to comment.