Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locations: Do not cancel operations after a volume has been umounted / removed #2200

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions 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 @@ -274,7 +274,8 @@ export const LocationAppInfo = GObject.registerClass({
iconsQuery.join(','),
Gio.FileQueryInfoFlags.NONE,
GLib.PRIORITY_LOW, cancellable);
icons.standard = info.get_icon();
if (info.has_attribute(Gio.FILE_ATTRIBUTE_STANDARD_ICON))
icons.standard = info.get_icon();
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) ||
e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_MOUNTED))
Expand Down Expand Up @@ -1410,6 +1411,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