mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
app-chooser-dialog: cancel the PK operation when the dialog is dismissed
This doesn't really seem to have any effect; probably PK doesn't listen for changes on the passed-in cancellable, but it's correct. Related to: https://bugzilla.gnome.org/show_bug.cgi?id=649121
This commit is contained in:
parent
623b5192cc
commit
2ae2c443d0
@ -146,6 +146,7 @@ search_for_mimetype_ready_cb (GObject *source,
|
||||
}
|
||||
|
||||
out:
|
||||
g_clear_object (&self->priv->online_cancellable);
|
||||
g_clear_error (&error);
|
||||
g_object_unref (self);
|
||||
|
||||
@ -296,6 +297,16 @@ add_or_find_application (GtkAppChooserDialog *self)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cancel_and_clear_cancellable (GtkAppChooserDialog *self)
|
||||
{
|
||||
if (self->priv->online_cancellable != NULL)
|
||||
{
|
||||
g_cancellable_cancel (self->priv->online_cancellable);
|
||||
g_clear_object (&self->priv->online_cancellable);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_app_chooser_dialog_response (GtkDialog *dialog,
|
||||
gint response_id,
|
||||
@ -310,6 +321,7 @@ gtk_app_chooser_dialog_response (GtkDialog *dialog,
|
||||
break;
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
case GTK_RESPONSE_DELETE_EVENT:
|
||||
cancel_and_clear_cancellable (self);
|
||||
self->priv->dismissed = TRUE;
|
||||
default :
|
||||
break;
|
||||
@ -631,14 +643,9 @@ gtk_app_chooser_dialog_dispose (GObject *object)
|
||||
GtkAppChooserDialog *self = GTK_APP_CHOOSER_DIALOG (object);
|
||||
|
||||
g_clear_object (&self->priv->gfile);
|
||||
cancel_and_clear_cancellable (self);
|
||||
g_clear_object (&self->priv->online);
|
||||
|
||||
if (self->priv->online_cancellable != NULL)
|
||||
{
|
||||
g_cancellable_cancel (self->priv->online_cancellable);
|
||||
g_clear_object (&self->priv->online_cancellable);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gtk_app_chooser_dialog_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
@ -118,6 +118,7 @@ install_mime_types_ready_cb (GObject *source,
|
||||
}
|
||||
|
||||
g_simple_async_result_complete (self->priv->result);
|
||||
g_clear_object (&self->priv->result);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user