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>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user