[gnome-shell] js: Stop using Gio._LocalFilePrototype



commit 928f3288e92f498a271f13b83b5c5ae23e682b33
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 11 00:15:27 2022 +0100

    js: Stop using Gio._LocalFilePrototype
    
    gjs now supports overriding interface methods, so promisify()
    works on Gio.File itself, not just the LocalFilePrototype cludge.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2174>

 js/ui/background.js  | 2 +-
 js/ui/environment.js | 4 ++--
 js/ui/main.js        | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 281ef37e6e..7a22e803bb 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -101,7 +101,7 @@ const LoginManager = imports.misc.loginManager;
 const Main = imports.ui.main;
 const Params = imports.misc.params;
 
-Gio._promisify(Gio._LocalFilePrototype, 'query_info_async', 'query_info_finish');
+Gio._promisify(Gio.File.prototype, 'query_info_async', 'query_info_finish');
 
 var DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff);
 
diff --git a/js/ui/environment.js b/js/ui/environment.js
index dc9c5c9433..37c854cc36 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -372,10 +372,10 @@ function init() {
         },
     });
 
-    Gio._LocalFilePrototype.touch_async = function (callback) {
+    Gio.File.prototype.touch_async = function (callback) {
         Shell.util_touch_file_async(this, callback);
     };
-    Gio._LocalFilePrototype.touch_finish = function (result) {
+    Gio.File.prototype.touch_finish = function (result) {
         return Shell.util_touch_file_finish(this, result);
     };
 
diff --git a/js/ui/main.js b/js/ui/main.js
index d0fd97861e..8fa25bc43c 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -100,8 +100,8 @@ let _themeResource = null;
 let _oskResource = null;
 let _iconResource = null;
 
-Gio._promisify(Gio._LocalFilePrototype, 'delete_async', 'delete_finish');
-Gio._promisify(Gio._LocalFilePrototype, 'touch_async', 'touch_finish');
+Gio._promisify(Gio.File.prototype, 'delete_async', 'delete_finish');
+Gio._promisify(Gio.File.prototype, 'touch_async', 'touch_finish');
 
 let _remoteAccessInhibited = false;
 


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