Extension: Replace returned booleans in GLib sources by constants

This commit is contained in:
Romain Vigier
2022-03-13 18:49:43 +01:00
parent eec87793e3
commit 8cc8498bb6
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ class NightThemeSwitcher {
GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
while (!extensionManager._initialized)
continue;
return false;
return GLib.SOURCE_REMOVE;
});
console.debug('Extension Manager initialized.');
resolve();
+3 -3
View File
@@ -165,7 +165,7 @@ var TimerLocation = class {
console.debug('Regularly updating sun times...');
this.#regularlyUpdateSuntimesTimer = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 3600, () => {
this.#updateSuntimes();
return true; // Repeat the loop
return GLib.SOURCE_CONTINUE;
});
}
@@ -186,13 +186,13 @@ var TimerLocation = class {
this.#timeChangeTimer = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1, () => {
if (!Me.imports.extension.enabled) {
// The extension doesn't exist anymore, quit the loop
return false;
return GLib.SOURCE_REMOVE;
}
if (this.#previouslyDaytime !== this.#isDaytime()) {
this.#previouslyDaytime = this.#isDaytime();
this.emit('time-changed', this.time);
}
return true; // Repeat the loop
return GLib.SOURCE_CONTINUE;
});
}
+2 -2
View File
@@ -60,13 +60,13 @@ var TimerSchedule = class {
this.#timeChangeTimer = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1, () => {
if (!Me.imports.extension.enabled) {
// The extension doesn't exist anymore, quit the loop
return false;
return GLib.SOURCE_REMOVE;
}
if (this.#previouslyDaytime !== this.#isDaytime()) {
this.#previouslyDaytime = this.#isDaytime();
this.emit('time-changed', this.time);
}
return true; // Repeat the loop
return GLib.SOURCE_CONTINUE;
});
}