[gtk+] placesview: properly recover from cancellation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] placesview: properly recover from cancellation
- Date: Fri, 9 Sep 2016 20:56:05 +0000 (UTC)
commit 0e5b0b75c591e91e5bd4af401660b5dd0bb1d020
Author: Christian Kellner <christian kellner me>
Date: Sun Sep 4 15:28:11 2016 +0200
placesview: properly recover from cancellation
The current code wrongly assumes that cancellation can only happen
as a result widget finalization, and consequentially does not
properly recover from it. Therefore if the operation is cancelled
as a result of user interaction, the entry is will stay disabled
and the spinner will keep spinning. This is fixed by removal of
the early bail out in case of cancellation.
https://bugzilla.gnome.org/show_bug.cgi?id=764979
gtk/gtkplacesview.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index 581c4cc..dd2b019 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -1173,12 +1173,9 @@ server_mount_ready_cb (GObject *source_file,
emit_show_error_message (view, _("Unable to access location"), error->message);
should_show = FALSE;
}
- else
- {
- /* it was cancelled, so probably it was called during finalize, bail out. */
- g_clear_error (&error);
- return;
- }
+
+ /* The operation got cancelled by the user and or the error
+ has been handled already. */
g_clear_error (&error);
}
@@ -1247,13 +1244,9 @@ volume_mount_ready_cb (GObject *source_volume,
emit_show_error_message (GTK_PLACES_VIEW (user_data), _("Unable to access location"),
error->message);
should_show = FALSE;
}
- else
- {
- /* it was cancelled, so probably it was called during finalize, bail out. */
- g_clear_error (&error);
- return;
- }
+ /* The operation got cancelled by the user and or the error
+ has been handled already. */
g_clear_error (&error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]