mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
extensionSystem: Add "UninstallExtension" DBus method
For those who like their system pure, this provides the ability to purge a pesky extension and its precious place on your disk space, and in your "Local Extension" list. https://bugzilla.gnome.org/show_bug.cgi?id=658612 Conflicts: js/ui/extensionSystem.js
This commit is contained in:
parent
d5e6ea6ebd
commit
7928f90cf6
3 changed files with 62 additions and 0 deletions
|
|
@ -20,3 +20,25 @@ function listDirAsync(file, callback) {
|
|||
enumerator.next_files_async(100, GLib.PRIORITY_LOW, null, onNextFileComplete);
|
||||
});
|
||||
}
|
||||
|
||||
function deleteGFile(file) {
|
||||
// Work around 'delete' being a keyword in JS.
|
||||
return file['delete'](null);
|
||||
}
|
||||
|
||||
function recursivelyDeleteDir(dir) {
|
||||
let children = dir.enumerate_children('standard::name,standard::type',
|
||||
Gio.FileQueryInfoFlags.NONE, null);
|
||||
|
||||
let info, child;
|
||||
while ((info = children.next_file(null)) != null) {
|
||||
let type = info.get_file_type();
|
||||
let child = dir.get_child(info.get_name());
|
||||
if (type == Gio.FileType.REGULAR)
|
||||
deleteGFile(child);
|
||||
else if (type == Gio.TypeType.DIRECTORY)
|
||||
recursivelyDeleteDir(child);
|
||||
}
|
||||
|
||||
deleteGFile(dir);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue