diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js index c924af590..a403cdb7f 100644 --- a/js/extensionPrefs/main.js +++ b/js/extensionPrefs/main.js @@ -268,7 +268,6 @@ function initEnvironment() { function main(argv) { initEnvironment(); - ExtensionUtils.init(); Gettext.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); Gettext.textdomain(Config.GETTEXT_PACKAGE); diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js index 1065f3693..d08648413 100644 --- a/js/misc/extensionUtils.js +++ b/js/misc/extensionUtils.js @@ -14,9 +14,6 @@ const ExtensionType = { PER_USER: 2 }; -// GFile for user extensions -var userExtensionsDir = null; - // Maps uuid -> metadata object const extensions = {}; @@ -152,11 +149,6 @@ function installImporter(extension) { _extension = null; } -function init() { - let userExtensionsPath = GLib.build_filenamev([global.userdatadir, 'extensions']); - userExtensionsDir = Gio.file_new_for_path(userExtensionsPath); -} - function scanExtensionsInDirectory(callback, dir, type) { let fileEnum; let file, info; @@ -179,8 +171,10 @@ function scanExtensionsInDirectory(callback, dir, type) { } function scanExtensions(callback) { - let systemDataDirs = GLib.get_system_data_dirs(); + let userExtensionsDir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions'])); scanExtensionsInDirectory(callback, userExtensionsDir, ExtensionType.PER_USER); + + let systemDataDirs = GLib.get_system_data_dirs(); for (let i = 0; i < systemDataDirs.length; i++) { let dirPath = GLib.build_filenamev([systemDataDirs[i], 'gnome-shell', 'extensions']); let dir = Gio.file_new_for_path(dirPath); diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js index f83100daf..eda387241 100644 --- a/js/ui/extensionDownloader.js +++ b/js/ui/extensionDownloader.js @@ -66,7 +66,7 @@ function gotExtensionZipFile(session, message, uuid) { return; } - let dir = ExtensionUtils.userExtensionsDir.get_child(uuid); + let dir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions', uuid])); try { if (!dir.query_exists(null)) dir.make_directory_with_parents(null); diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index fa2983a19..efb9144ea 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -257,8 +257,6 @@ function onEnabledExtensionsChanged() { } function init() { - ExtensionUtils.init(); - global.settings.connect('changed::' + ENABLED_EXTENSIONS_KEY, onEnabledExtensionsChanged); enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY); }