Skip to content

Commit

Permalink
locations: Do not cancel operations after a volume has been umounted …
Browse files Browse the repository at this point in the history
…/ removed

In case we're unmounting a volume we were optionally removing its icon
but this was also leading cancelling the operation that in the Gio queue
caused the action not to be fully performed.

So once, we've removed a volume or umounted a mount, we don't really
care about cancelling the ongoing operations since they should be done
already.

LP: #1993054
  • Loading branch information
3v1n0 committed Apr 18, 2024
1 parent 35e2b31 commit 32acbd3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const LocationAppInfo = GObject.registerClass({
Gio.Icon.$gtype),
'cancellable': GObject.ParamSpec.object(
'cancellable', 'cancellable', 'cancellable',
GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
GObject.ParamFlags.READWRITE,
Gio.Cancellable.$gtype),
},
}, class LocationAppInfo extends Gio.DesktopAppInfo {
Expand Down Expand Up @@ -1410,6 +1410,8 @@ export class Removables {
appInfo.volume === volume);
if (volumeIndex !== -1) {
const [volumeApp] = this._volumeApps.splice(volumeIndex, 1);
// We don't care about cancelling the ongoing operations from now on.
volumeApp.appInfo.cancellable = null;
volumeApp.destroy();
this.emit('changed');
}
Expand Down

0 comments on commit 32acbd3

Please sign in to comment.