Re: [rfc][patch] Add optional PackageKit hook to install new applications



On Wed, 2008-12-10 at 14:31 +0100, Alexander Larsson wrote:
> Before search_for_application_dbus_call_notify_cb is done executing?
> Thats weird? What does the stack trace look like at that time?

As discussed on IRC, attached patch attach fixes things. The only
problem now is the error report. At the moment we get this:

http://www.packagekit.org/temp/pk-nautilus-search.ogv

Now, don't panic about the "extra" confirm window. I'm working with the
KPackageKit and Ubuntu guys about adding a new interface to the session
service to be able to control what elements of the interaction are shown
and hidden. When we're all agreed, it'll be a two line patch to nautilus
to switch it from the basic interface to the new interface. In this case
we'll be using "hide-confirm-search".

The final error message is removed with the second (combined) patch. I
can use error->code if you like, although that means defining a
constant.

Richard.

Index: libnautilus-private/nautilus-mime-actions.c
===================================================================
--- libnautilus-private/nautilus-mime-actions.c	(revision 14808)
+++ libnautilus-private/nautilus-mime-actions.c	(working copy)
@@ -1078,6 +1078,7 @@
 		g_error_free (error);
 		return;
 	}
+	g_object_unref (proxy);
 
 	/* activate the file again */
 	nautilus_mime_activate_files (parameters_install->parent_window,
@@ -1158,9 +1159,6 @@
 		/* dbus method was not called, so we're not going to get the async dbus callback */
 		activate_parameters_install_free (parameters_install);
 	}
-	if (proxy != NULL) {
-		g_object_unref (proxy);
-	}
 }
 
 static void
Index: libnautilus-private/nautilus-mime-actions.c
===================================================================
--- libnautilus-private/nautilus-mime-actions.c	(revision 14808)
+++ libnautilus-private/nautilus-mime-actions.c	(working copy)
@@ -1072,12 +1072,16 @@
 	
 	ret = dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
 	if (!ret) {
-		eel_show_error_dialog (_("Unable to search for application"),
-				       _("There was an internal error trying to search for applications"),
-				       parameters_install->parent_window);
+		/* we already show an error in the installer if not found */
+		if (!g_str_has_prefix (error->message, "Method failed: nothing was found")) {
+			eel_show_error_dialog (_("Unable to search for application"),
+					       _("There was an internal error trying to search for applications"),
+					       parameters_install->parent_window);
+		}
 		g_error_free (error);
 		return;
 	}
+	g_object_unref (proxy);
 
 	/* activate the file again */
 	nautilus_mime_activate_files (parameters_install->parent_window,
@@ -1158,9 +1162,6 @@
 		/* dbus method was not called, so we're not going to get the async dbus callback */
 		activate_parameters_install_free (parameters_install);
 	}
-	if (proxy != NULL) {
-		g_object_unref (proxy);
-	}
 }
 
 static void


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