From 0fd160475c92240c476c8a28fcbd221c098c1348 Mon Sep 17 00:00:00 2001 From: daimler <11229630+germanztz@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:28:26 +0100 Subject: [PATCH 1/3] remove obsolete calls --- extension.js | 19 +++++++++++-------- fileMonitorHelper.js | 8 ++++---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/extension.js b/extension.js index 0b6637f..ee1dd78 100644 --- a/extension.js +++ b/extension.js @@ -12,8 +12,6 @@ import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'; import {FileMonitorHelper, PrefsFields, ProfileStatus} from './fileMonitorHelper.js'; import * as ConfirmDialog from './confirmDialog.js'; -const Mainloop = imports.mainloop - const INDICATOR_ICON = 'drive-multidisk-symbolic' const PROFILE_IDLE_ICON = 'radio-symbolic' const PROFILE_WATCHED_ICON = 'folder-saved-search-symbolic' @@ -123,22 +121,26 @@ const RcloneManagerIndicator = GObject.registerClass( _resetCheckInterval() { this._removeCheckInterval() + const that = this if (this.PREF_CHECK_INTERVAL !== 0) { this.fmh.PREF_DBG && log(`rcm._resetCheckInterval, interval: ${this.PREF_CHECK_INTERVAL}`) - this.checkTimeoutId = Mainloop.timeout_add(this.PREF_CHECK_INTERVAL * 60000, () => { - Object.entries(this._registry) + this.checkTimeoutId = GLib.timeout_source_new(this.PREF_CHECK_INTERVAL * 60000) + this.checkTimeoutId.attach(null) + this.checkTimeoutId.set_callback( () => { + this.fmh.PREF_DBG && log(`rcm._resetCheckInterval running`) + Object.entries(that._registry) .filter(p => p[1].syncType === ProfileStatus.WATCHED) - .forEach(p => this.fmh.checkNsync(p[0], (profile, status, message) => { this._onProfileStatusChanged(profile, status, message) })) + .forEach(p => that.fmh.checkNsync(p[0], (profile, status, message) => { that._onProfileStatusChanged(profile, status, message) })) return true }) } } _removeCheckInterval() { - if (this.checkTimeoutId) { + if(this.checkTimeoutId){ this.fmh.PREF_DBG && log('rcm._removeCheckInterval') - Mainloop.source_remove(this.checkTimeoutId) - this.checkTimeoutId = null + this.checkTimeoutId.destroy() + this.checkTimeoutId = null } } @@ -495,6 +497,7 @@ const RcloneManagerIndicator = GObject.registerClass( export default class RcloneManager extends Extension { enable() { + log('rcm.enable') this._rcm = new RcloneManagerIndicator( this ); Main.panel.addToStatusArea(this.uuid, this._rcm); } diff --git a/fileMonitorHelper.js b/fileMonitorHelper.js index 977fd04..7e91076 100644 --- a/fileMonitorHelper.js +++ b/fileMonitorHelper.js @@ -7,7 +7,6 @@ */ import GLib from 'gi://GLib' import Gio from 'gi://Gio' -const byteArray = imports.byteArray export const PrefsFields = { PREFKEY_RCONFIG_FILE_PATH: 'prefkey001-rconfig-file-path', @@ -77,6 +76,7 @@ export class FileMonitorHelper { this._monitors = {} this._configMonitor = null + this._textDecoder = new TextDecoder() } @@ -665,8 +665,8 @@ export class FileMonitorHelper { // Child setup function null) - if (stderr instanceof Uint8Array) stderr = byteArray.toString(stderr) - if (stdout instanceof Uint8Array) stdout = byteArray.toString(stdout) + if (stderr instanceof Uint8Array) stderr = this._textDecoder.decode(stderr) + if (stdout instanceof Uint8Array) stdout = this._textDecoder.decode(stdout) this.PREF_DBG && log(`fmh.spawnSync, status=${exitStatus}, stderr=${stderr}, stdout=${stdout}`) if (exitStatus !== 0) throw new Error(stderr); return [exitStatus, stdout, stderr] @@ -701,7 +701,7 @@ export class FileMonitorHelper { try { // are we running gnome 3.30 or higher? if (contents instanceof Uint8Array) { - callbackFunction(imports.byteArray.toString(contents)) + callbackFunction(this._textDecoder.decode(contents)) } else { callbackFunction('File contents are no Uint8Array') } From f00130497e9946ce9e18ea375ee6e8c0f31906e7 Mon Sep 17 00:00:00 2001 From: daimler <11229630+germanztz@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:30:32 +0100 Subject: [PATCH 2/3] remove obsolete calls --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index faa299c..d0ed869 100644 --- a/metadata.json +++ b/metadata.json @@ -6,7 +6,7 @@ "name": "rclone-manager", "description": "Is like Dropbox sync client but for more than 30 services, adds an indicator to the top panel so you can manage the rclone profiles configured in your system, perform operations such as mount as remote, watch for file modifications, sync with remote storage, navigate it's main folder. Also, it shows the status of each profile so you can supervise the operations, and provides an easy access log of events. Backup and restore the rclone configuration file, so you won't have to configure all your devices one by one", "url": "https://github.com/germanztz/gnome-shell-extension-rclone-manager", - "version": 45.0, + "version": 45.1, "gettext-domain": "rclone-manager", "settings-schema": "org.gnome.shell.extensions.rclone-manager" } \ No newline at end of file From 2a49055f9883ea27e04e505c61975cf9c7e22aa0 Mon Sep 17 00:00:00 2001 From: daimler <11229630+germanztz@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:31:36 +0100 Subject: [PATCH 3/3] remove obsolete calls --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5fe97c4..d282907 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,10 @@ Zoho WorkDrive| The local filesystem # ChangeLog +## v45.1 + +- [x] Remove obsolete calls + ## v45.0 - [x] Shell 45 version update