If DBus is not running on the system, make Tilda work as usual,
minus the DBus IPC, of course. This makes many of the new features
unavailable, but at least Tilda does not crash.
Note that Tilda will still crash if you kill DBus out from underneath
it. I'm very sure this happens to most (all?) programs that use DBus
for IPC. Fortunately, DBus is very stable.
static const gchar object_path[] = "/net/sourceforge/Tilda";
+ /* If DBus is not running, leave */
+ if (!dbus_connection)
+ return;
+
dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(self));
}
TildaWindow *parent_window = TILDA_WINDOW(tt->parent_window);
gchar *object_path;
- // Register this object with DBus
+ /* If DBus is not running, leave */
+ if (!dbus_connection)
+ return;
+
+ /* Register this object with DBus */
object_path = g_strdup_printf ("/net/sourceforge/Tilda/Window%d/Terminal%d",
parent_window->number, tt->number);
dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(tt));
gchar *object_path;
- // Register this object with DBus
+ /* If DBus is not running, leave */
+ if (!dbus_connection)
+ return;
+
+ /* Register this object with DBus */
object_path = g_strdup_printf ("/net/sourceforge/Tilda/Window%d", self->number);
dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(self));
g_free (object_path);
#include "tomboykeybinder.h"
/* Project-global variables */
-DBusGConnection *dbus_connection;
+DBusGConnection *dbus_connection = NULL;
static void
tilda_dbus_init ()