[gnome-shell-extensions] cleanup: Simplify promisify() calls



commit b92973df0036df5468682cb4bc9b68421746639e
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 10 08:38:50 2022 +0100

    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: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/214>

 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 5a70c44..75e7763 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 a504c7b..5d04599 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 5430478..4177683 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 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]