[gjs: 1/2] Temporary fix for Gio.File.prototype



commit 42be3ff2016134877a52561573f78f8c20020004
Author: Avi Zajac <avirzajac gmail com>
Date:   Fri Aug 17 14:54:12 2018 -0700

    Temporary fix for Gio.File.prototype
    
    Issue #189 details the current dilemma of being unable to add or
    monkeypatch methods on a GObject interface. At this time developers
    must add an additional line of code to their applications to use
    Gio.File.prototype. This is a temporary fix faking it until such a
    fix has been made for that issue.
    
    Example:
    promisify(Gio._LocalFilePrototype, load_contents_async, load_contents_finish);

 modules/overrides/Gio.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/modules/overrides/Gio.js b/modules/overrides/Gio.js
index 23a0648e..0092b99b 100644
--- a/modules/overrides/Gio.js
+++ b/modules/overrides/Gio.js
@@ -401,4 +401,7 @@ function _init() {
 
     // ListStore
     Gio.ListStore.prototype[Symbol.iterator] = _listModelIterator;
+
+    // Temporary Gio.File.prototype fix
+    Gio._LocalFilePrototype = Gio.File.new_for_path('').constructor.prototype;
 }


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