extensionUtils: Remove userExtensionsDir
Make this less stateful https://bugzilla.gnome.org/show_bug.cgi?id=677586
This commit is contained in:
parent
cdbe0bbf38
commit
5265884af9
@ -268,7 +268,6 @@ function initEnvironment() {
|
||||
|
||||
function main(argv) {
|
||||
initEnvironment();
|
||||
ExtensionUtils.init();
|
||||
|
||||
Gettext.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
|
||||
Gettext.textdomain(Config.GETTEXT_PACKAGE);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user