Skip to content

Commit

Permalink
Merge branch 'v45'
Browse files Browse the repository at this point in the history
  • Loading branch information
germanztz committed Dec 12, 2023
2 parents ba8448d + 2a49055 commit df683b6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ Zoho WorkDrive| The local filesystem

# ChangeLog

## v45.1

- [x] Remove obsolete calls

## v45.0

- [x] Shell 45 version update
Expand Down
19 changes: 11 additions & 8 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions fileMonitorHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -77,6 +76,7 @@ export class FileMonitorHelper {

this._monitors = {}
this._configMonitor = null
this._textDecoder = new TextDecoder()

}

Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit df683b6

Please sign in to comment.