[gtk+/open-with-dialog] open-with-pk: don't set error if the user cancelled the installation



commit ae30761371f7c3160c109575c2d52f70674c53fd
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Nov 19 18:33:05 2010 +0100

    open-with-pk: don't set error if the user cancelled the installation

 gtk/gtkopenwithonlinepk.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkopenwithonlinepk.c b/gtk/gtkopenwithonlinepk.c
index 28a45a8..939f42d 100644
--- a/gtk/gtkopenwithonlinepk.c
+++ b/gtk/gtkopenwithonlinepk.c
@@ -98,7 +98,10 @@ install_mime_types_ready_cb (GObject *source,
   variant = g_dbus_proxy_call_finish (proxy, res, &error);
 
   if (variant == NULL) {
-    g_simple_async_result_set_from_error (self->priv->result, error);
+    /* don't show errors if the user cancelled the installation explicitely */
+    if (g_strcmp0 (g_dbus_error_get_remote_error (error), "org.freedesktop.PackageKit.Modify.Cancelled") != 0)
+      g_simple_async_result_set_from_error (self->priv->result, error);
+
     g_error_free (error);
   }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]