[gtk+/open-with-dialog: 47/52] open-with-pk: don't show an error if no apps are found



commit 9d550fe42ac5486cb364e1b620fc67afd5a662ec
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Nov 23 12:47:44 2010 +0100

    open-with-pk: don't show an error if no apps are found
    
    gnome-packagekit already shows a message dialog for us.

 gtk/gtkopenwithonlinepk.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkopenwithonlinepk.c b/gtk/gtkopenwithonlinepk.c
index 939f42d..e32015d 100644
--- a/gtk/gtkopenwithonlinepk.c
+++ b/gtk/gtkopenwithonlinepk.c
@@ -98,8 +98,11 @@ install_mime_types_ready_cb (GObject *source,
   variant = g_dbus_proxy_call_finish (proxy, res, &error);
 
   if (variant == NULL) {
-    /* 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)
+    /* don't show errors if the user cancelled the installation explicitely
+     * or if PK wasn't able to find any apps
+     */
+    if (g_strcmp0 (g_dbus_error_get_remote_error (error), "org.freedesktop.PackageKit.Modify.Cancelled") != 0 &&
+	g_strcmp0 (g_dbus_error_get_remote_error (error), "org.freedesktop.PackageKit.Modify.NoPackagesFound") != 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]