[gedit/dbus] Be a bit nicer when we fail to initialize dbus stuff



commit 15062147967f983ce257c157429631aef0acb81d
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Mon May 3 21:46:29 2010 +0200

    Be a bit nicer when we fail to initialize dbus stuff

 gedit/gedit-dbus.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-dbus.c b/gedit/gedit-dbus.c
index c86a61e..a00deb7 100644
--- a/gedit/gedit-dbus.c
+++ b/gedit/gedit-dbus.c
@@ -348,6 +348,7 @@ handle_slave (GeditDBus *dbus)
 
 	if (conn == NULL)
 	{
+		g_warning ("Could not connect to session bus");
 		return GEDIT_DBUS_RESULT_FAILED;
 	}
 
@@ -894,7 +895,14 @@ gedit_dbus_run (GeditDBus *dbus)
 	if (gedit_command_line_get_wait (command_line) ||
 	    gedit_command_line_get_background (command_line))
 	{
-		return handle_service (dbus);
+		GeditDBusResult ret = handle_service (dbus);
+
+		/* We actually continue if it failed, because it's nicer to
+		   still start some kind of gedit in that case */
+		if (ret != GEDIT_DBUS_RESULT_FAILED)
+		{
+			return ret;
+		}
 	}
 
 	id = g_bus_own_name (G_BUS_TYPE_SESSION,



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