[Xfce4-commits] [xfce/thunar] 42/46: Add missing gdbus handlers
noreply at xfce.org
noreply at xfce.org
Tue Aug 15 02:35:50 CEST 2017
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/thunar.
commit 373b747c222640ce3df776b1ae66790856c06da4
Author: acs <acs82 at gmx.de>
Date: Wed Jul 26 23:27:55 2017 +0200
Add missing gdbus handlers
---
thunar/thunar-application.c | 52 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 47 insertions(+), 5 deletions(-)
diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 120e59d..6ea5723 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -112,6 +112,17 @@ static void thunar_application_set_property (GObject
guint prop_id,
const GValue *value,
GParamSpec *pspec);
+static void thunar_application_init (ThunarApplication *application);
+static void thunar_application_dbus_acquired_cb (GDBusConnection *conn,
+ const gchar *name,
+ gpointer user_data);
+static void thunar_application_name_acquired_cb (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data);
+static void thunar_application_dbus_name_lost_cb (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data);
+static void thunar_application_dbus_init (ThunarApplication *application);
static void thunar_application_startup (GApplication *application);
static void thunar_application_shutdown (GApplication *application);
static void thunar_application_activate (GApplication *application);
@@ -281,18 +292,49 @@ thunar_application_init (ThunarApplication *application)
}
+static void
+thunar_application_dbus_acquired_cb (GDBusConnection *conn,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_debug (_("Acquired the session message bus '%s'\n"), name);
+}
+
+
+
+static void
+thunar_application_name_acquired_cb (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ g_debug (_("Acquired the name '%s' on the session message bus\n"), name);
+}
+
+
+
+static void
+thunar_application_dbus_name_lost_cb (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ ThunarApplication *application = user_data;
+ g_critical (_("Name '%s' lost on the message dbus, exiting."), name);
+ g_application_quit (G_APPLICATION (application));
+}
+
+
/* TODO: [GTK3 Port] Check if there's a cleaner way to register */
/* this extra dbus name (besides org.xfce.Thunar) */
static void
-thunar_dbus_init (ThunarApplication *application)
+thunar_application_dbus_init (ThunarApplication *application)
{
application->dbus_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
"org.xfce.FileManager",
G_BUS_NAME_OWNER_FLAGS_NONE,
- NULL,
- NULL,
- NULL,
+ thunar_application_dbus_acquired_cb,
+ thunar_application_name_acquired_cb,
+ thunar_application_dbus_name_lost_cb,
application,
NULL);
}
@@ -340,7 +382,7 @@ thunar_application_startup (GApplication *gapp)
/* connect to the session manager */
application->session_client = thunar_session_client_new (opt_sm_client_id);
- thunar_dbus_init (application);
+ thunar_application_dbus_init (application);
G_APPLICATION_CLASS (thunar_application_parent_class)->startup (gapp);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list