[gnome-shell-extensions/wip/fmuellner/misc-cleanups: 2/12] cleanup: Share unmount/eject arugments
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/wip/fmuellner/misc-cleanups: 2/12] cleanup: Share unmount/eject arugments
- Date: Mon, 4 Mar 2019 18:36:59 +0000 (UTC)
commit 1f1f9664a6aa271bce4b2fde8da5ee60124d4eba
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Mar 2 23:22:42 2019 +0100
cleanup: Share unmount/eject arugments
Besides the callback, eject and unmount share the same arguments.
Make this explicit by sharing the common arguments between branches.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/60
extensions/drive-menu/extension.js | 14 +++++++-------
extensions/places-menu/placeDisplay.js | 14 +++++++-------
2 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js
index 51b4aa6..7c8e36c 100644
--- a/extensions/drive-menu/extension.js
+++ b/extensions/drive-menu/extension.js
@@ -65,17 +65,17 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
}
_eject() {
- let mountOp = new ShellMountOperation.ShellMountOperation(this.mount);
+ let unmountArgs = [
+ Gio.MountUnmountFlags.NONE,
+ (new ShellMountOperation.ShellMountOperation(this.mount)).mountOp,
+ null // Gio.Cancellable
+ ];
if (this.mount.can_eject())
- this.mount.eject_with_operation(Gio.MountUnmountFlags.NONE,
- mountOp.mountOp,
- null, // Gio.Cancellable
+ this.mount.eject_with_operation(...unmountArgs,
this._ejectFinish.bind(this));
else
- this.mount.unmount_with_operation(Gio.MountUnmountFlags.NONE,
- mountOp.mountOp,
- null, // Gio.Cancellable
+ this.mount.unmount_with_operation(...unmountArgs,
this._unmountFinish.bind(this));
}
diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js
index 037a339..16f5417 100644
--- a/extensions/places-menu/placeDisplay.js
+++ b/extensions/places-menu/placeDisplay.js
@@ -183,17 +183,17 @@ class PlaceDeviceInfo extends PlaceInfo {
}
eject() {
- let mountOp = new ShellMountOperation.ShellMountOperation(this._mount);
+ let unmountArgs = [
+ Gio.MountUnmountFlags.NONE,
+ (new ShellMountOperation.ShellMountOperation(this._mount)).mountOp,
+ null // Gio.Cancellable
+ ];
if (this._mount.can_eject())
- this._mount.eject_with_operation(Gio.MountUnmountFlags.NONE,
- mountOp.mountOp,
- null, // Gio.Cancellable
+ this._mount.eject_with_operation(...unmountArgs,
this._ejectFinish.bind(this));
else
- this._mount.unmount_with_operation(Gio.MountUnmountFlags.NONE,
- mountOp.mountOp,
- null, // Gio.Cancellable
+ this._mount.unmount_with_operation(...unmountArgs,
this._unmountFinish.bind(this));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]