cleanup: Use type-safe comparisons
We have been using type-safe comparisons in new code for quite a while now, however old code has only been adapted slowly. Change all the remaining bits to get rid of another legacy style difference. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
This commit is contained in:

committed by
Marge Bot

parent
9a3913d4a0
commit
a42f7c2384
@ -54,9 +54,9 @@ export function recursivelyDeleteDir(dir, deleteParent) {
|
||||
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)
|
||||
if (type === Gio.FileType.REGULAR)
|
||||
child.delete(null);
|
||||
else if (type == Gio.FileType.DIRECTORY)
|
||||
else if (type === Gio.FileType.DIRECTORY)
|
||||
recursivelyDeleteDir(child, true);
|
||||
}
|
||||
|
||||
@ -80,9 +80,9 @@ export function recursivelyMoveDir(srcDir, destDir) {
|
||||
let type = info.get_file_type();
|
||||
let srcChild = srcDir.get_child(info.get_name());
|
||||
let destChild = destDir.get_child(info.get_name());
|
||||
if (type == Gio.FileType.REGULAR)
|
||||
if (type === Gio.FileType.REGULAR)
|
||||
srcChild.move(destChild, Gio.FileCopyFlags.NONE, null, null);
|
||||
else if (type == Gio.FileType.DIRECTORY)
|
||||
else if (type === Gio.FileType.DIRECTORY)
|
||||
recursivelyMoveDir(srcChild, destChild);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user