[gnome-shell/wip/fmuellner/fix-distcheck] fileUtils: Make loadInterfaceXML usable from tests



commit 00613b304f333b7a1b18987c1256c5668b9b7481
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Oct 8 21:24:00 2018 +0200

    fileUtils: Make loadInterfaceXML usable from tests
    
    The current code assumes that the resource has been installed,
    which isn't the case when running distcheck.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/255

 js/misc/fileUtils.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/js/misc/fileUtils.js b/js/misc/fileUtils.js
index 24add2e7e..32c08759e 100644
--- a/js/misc/fileUtils.js
+++ b/js/misc/fileUtils.js
@@ -75,8 +75,9 @@ function recursivelyMoveDir(srcDir, destDir) {
 let _ifaceResource = null;
 function loadInterfaceXML(iface) {
     if (!_ifaceResource) {
-        // don't use global.datadir so the method is usable from tools
-        let path = Config.PKGDATADIR + '/gnome-shell-dbus-interfaces.gresource';
+        // don't use global.datadir so the method is usable from tests/tools
+        let dir = GLib.getenv ('GNOME_SHELL_DATADIR') || Config.PKGDATADIR;
+        let path = dir + '/gnome-shell-dbus-interfaces.gresource';
         _ifaceResource = Gio.Resource.load(path);
         _ifaceResource._register();
     }


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