nautilus r14809 - in trunk: . libnautilus-private



Author: alexl
Date: Thu Dec 11 08:40:56 2008
New Revision: 14809
URL: http://svn.gnome.org/viewvc/nautilus?rev=14809&view=rev

Log:
2008-12-11  Alexander Larsson  <alexl redhat com>

        * libnautilus-private/nautilus-mime-actions.c:
	Ref the dbus proxy over the call, this means we actually get the callback, so
	remove the got_reply stuff.




Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-mime-actions.c

Modified: trunk/libnautilus-private/nautilus-mime-actions.c
==============================================================================
--- trunk/libnautilus-private/nautilus-mime-actions.c	(original)
+++ trunk/libnautilus-private/nautilus-mime-actions.c	Thu Dec 11 08:40:56 2008
@@ -1033,7 +1033,6 @@
 	NautilusWindowOpenFlags flags;
 	char *activation_directory;
 	gboolean user_confirmation;
-	gboolean got_reply;
 } ActivateParametersInstall;
 
 static void
@@ -1051,25 +1050,11 @@
 }
 
 static void
-activate_parameters_install_free_with_error (ActivateParametersInstall *parameters_install)
-{
-	if (!parameters_install->got_reply) {
-		eel_show_error_dialog (_("Unable to search for application"),
-				       _("There was an internal error trying to search for applications"),
-				       parameters_install->parent_window);
-	}
-		
-	activate_parameters_install_free (parameters_install);
-}
-
-static void
 search_for_application_dbus_call_notify_cb (DBusGProxy *proxy, DBusGProxyCall *call, ActivateParametersInstall *parameters_install)
 {
 	gboolean ret;
 	GError *error = NULL;
 
-	parameters_install->got_reply = TRUE;
-	
 	ret = dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
 	if (!ret) {
 		eel_show_error_dialog (_("Unable to search for application"),
@@ -1078,6 +1063,7 @@
 		g_error_free (error);
 		return;
 	}
+	g_object_unref (proxy);
 
 	/* activate the file again */
 	nautilus_mime_activate_files (parameters_install->parent_window,
@@ -1133,7 +1119,7 @@
 	call = dbus_g_proxy_begin_call (proxy, "InstallMimeType",
 					(DBusGProxyCallNotify) search_for_application_dbus_call_notify_cb,
 					parameters_install,
-					(GDestroyNotify) activate_parameters_install_free_with_error,
+					(GDestroyNotify) activate_parameters_install_free,
 				        G_TYPE_UINT, xid,
 				        G_TYPE_UINT, 0,
 				        G_TYPE_STRING, mime_type,
@@ -1158,9 +1144,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]