From b92973df0036df5468682cb4bc9b68421746639e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 10 Feb 2022 08:38:50 +0100 Subject: [PATCH] cleanup: Simplify promisify() calls If the finish function isn't specified, promisify will now try to use the async name without '_async'/'_begin' suffix (if any) and '_finish' appended. Part-of: --- extensions/drive-menu/extension.js | 3 +-- extensions/places-menu/placeDisplay.js | 4 ++-- extensions/user-theme/prefs.js | 9 +++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 5a70c446..75e7763e 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -10,8 +10,7 @@ const ShellMountOperation = imports.ui.shellMountOperation; const _ = ExtensionUtils.gettext; -Gio._promisify(Gio.File.prototype, - 'query_filesystem_info_async', 'query_filesystem_info_finish'); +Gio._promisify(Gio.File.prototype, 'query_filesystem_info_async'); var MountMenuItem = GObject.registerClass( class MountMenuItem extends PopupMenu.PopupBaseMenuItem { diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index a504c7b5..5d04599b 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -10,8 +10,8 @@ const ShellMountOperation = imports.ui.shellMountOperation; const _ = ExtensionUtils.gettext; const N_ = x => x; -Gio._promisify(Gio.AppInfo, 'launch_default_for_uri_async', 'launch_default_for_uri_finish'); -Gio._promisify(Gio.File.prototype, 'mount_enclosing_volume', 'mount_enclosing_volume_finish'); +Gio._promisify(Gio.AppInfo, 'launch_default_for_uri_async'); +Gio._promisify(Gio.File.prototype, 'mount_enclosing_volume'); const BACKGROUND_SCHEMA = 'org.gnome.desktop.background'; diff --git a/extensions/user-theme/prefs.js b/extensions/user-theme/prefs.js index 54304787..41776834 100644 --- a/extensions/user-theme/prefs.js +++ b/extensions/user-theme/prefs.js @@ -11,12 +11,9 @@ const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Util = Me.imports.util; -Gio._promisify(Gio.File.prototype, - 'enumerate_children_async', 'enumerate_children_finish'); -Gio._promisify(Gio.File.prototype, - 'query_info_async', 'query_info_finish'); -Gio._promisify(Gio.FileEnumerator.prototype, - 'next_files_async', 'next_files_finish'); +Gio._promisify(Gio.File.prototype, 'enumerate_children_async'); +Gio._promisify(Gio.File.prototype, 'query_info_async'); +Gio._promisify(Gio.FileEnumerator.prototype, 'next_files_async'); const UserThemePrefsWidget = GObject.registerClass( class UserThemePrefsWidget extends Adw.PreferencesGroup {