Commit 0a9e1b41 authored by Florian Müllner's avatar Florian Müllner Committed by Georges Basile Stavracas Neto

fileUtils: Delete deleteGFile hack

It is true that delete is a javascript keyword, but that doesn't
prevent it from being used as method name - there are event built-in
types like Map or Set with delete() methods!

So if that hack was ever needed, this hasn't been the case for years
now; just removed the hack now.

GNOME/gnome-shell!862
parent 66f4feeb
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported collectFromDatadirs, deleteGFile, recursivelyDeleteDir,
/* exported collectFromDatadirs, recursivelyDeleteDir,
recursivelyMoveDir, loadInterfaceXML */
const { Gio, GLib } = imports.gi;
......@@ -29,11 +29,6 @@ function collectFromDatadirs(subdir, includeUserDir, processFile) {
}
}
function deleteGFile(file) {
// Work around 'delete' being a keyword in JS.
return file['delete'](null);
}
function recursivelyDeleteDir(dir, deleteParent) {
let children = dir.enumerate_children('standard::name,standard::type',
Gio.FileQueryInfoFlags.NONE, null);
......@@ -43,13 +38,13 @@ function recursivelyDeleteDir(dir, deleteParent) {
let type = info.get_file_type();
let child = dir.get_child(info.get_name());
if (type == Gio.FileType.REGULAR)
deleteGFile(child);
child.delete(null);
else if (type == Gio.FileType.DIRECTORY)
recursivelyDeleteDir(child, true);
}
if (deleteParent)
deleteGFile(dir);
dir.delete(null);
}
function recursivelyMoveDir(srcDir, destDir) {
......
......@@ -41,7 +41,7 @@ var ExtensionManager = class {
}
GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 60, () => {
FileUtils.deleteGFile(disableFile);
disableFile.delete(null);
return GLib.SOURCE_REMOVE;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment