From 8cc8498bb6ca72150ae5824157411379be5b45e0 Mon Sep 17 00:00:00 2001 From: Romain Vigier Date: Sun, 13 Mar 2022 18:49:43 +0100 Subject: [PATCH] Extension: Replace returned booleans in GLib sources by constants --- src/extension.js | 2 +- src/modules/TimerLocation.js | 6 +++--- src/modules/TimerSchedule.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extension.js b/src/extension.js index 6b794d1..ed65cbc 100644 --- a/src/extension.js +++ b/src/extension.js @@ -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(); diff --git a/src/modules/TimerLocation.js b/src/modules/TimerLocation.js index e0be2fc..d050f2a 100644 --- a/src/modules/TimerLocation.js +++ b/src/modules/TimerLocation.js @@ -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; }); } diff --git a/src/modules/TimerSchedule.js b/src/modules/TimerSchedule.js index 165ce78..233891f 100644 --- a/src/modules/TimerSchedule.js +++ b/src/modules/TimerSchedule.js @@ -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; }); }