]> git.0d.be Git - empathy.git/commitdiff
add empathy-bus-names.h
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 6 Feb 2014 13:58:51 +0000 (14:58 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 6 Feb 2014 14:32:57 +0000 (15:32 +0100)
It's convenient to have a single file containing all the D-Bus names so a
component can easily call a method on another one.

Also rename from DBUS_NAME to BUS_NAME to stay coherent with the TP_BUS_NAME.

https://bugzilla.gnome.org/show_bug.cgi?id=723766

libempathy/Makefile.am
libempathy/empathy-bus-names.h [new file with mode: 0644]
src/empathy-accounts.c
src/empathy-call.c
src/empathy-chat.c
src/empathy-debugger.c
src/empathy.c

index 2677811858e6a00529f96fbf1c4687741c8684d4..b87b35b944056dc579193943ee2febc714f375f9 100644 (file)
@@ -28,6 +28,7 @@ BUILT_SOURCES =                                       \
 libempathy_headers =                           \
        action-chain-internal.h                 \
        empathy-auth-factory.h                  \
+       empathy-bus-names.h                     \
        empathy-chatroom-manager.h              \
        empathy-chatroom.h                      \
        empathy-client-factory.h \
diff --git a/libempathy/empathy-bus-names.h b/libempathy/empathy-bus-names.h
new file mode 100644 (file)
index 0000000..62dba70
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * empathy-bus-names.h
+ *
+ * Copyright (C) 2014 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __EMPATHY_BUS_NAMES_H__
+#define __EMPATHY_BUS_NAMES_H__
+
+#define EMPATHY_BUS_NAME "org.gnome.Empathy"
+#define EMPATHY_CALL_BUS_NAME "org.gnome.Empathy.Call"
+#define EMPATHY_CHAT_BUS_NAME "org.gnome.Empathy.Chat"
+#define EMPATHY_DEBUGGER_BUS_NAME "org.gnome.Empathy.Debugger"
+#define EMPATHY_ACCOUNTS_BUS_NAME "org.gnome.EmpathyAccounts"
+
+#endif /* #ifndef __EMPATHY_BUS_NAMES_H__*/
index 60bba82dd630969cdcfa859825e7db191f6b8501..689c36d22d4ce66bef75fe579ebdd9f4b0292a84 100644 (file)
 #endif
 
 #include "empathy-accounts-common.h"
+#include "empathy-bus-names.h"
 #include "empathy-ui-utils.h"
 #include "empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT
 #include "empathy-debug.h"
 
-#define EMPATHY_ACCOUNTS_DBUS_NAME "org.gnome.EmpathyAccounts"
-
 static gboolean only_if_needed = FALSE;
 static gboolean hidden = FALSE;
 static gchar *selected_account_name = NULL;
@@ -243,7 +242,7 @@ main (int argc, char *argv[])
   gdk_set_program_class ("Empathy");
   gtk_window_set_default_icon_name ("empathy");
 
-  app = gtk_application_new (EMPATHY_ACCOUNTS_DBUS_NAME, G_APPLICATION_FLAGS_NONE);
+  app = gtk_application_new (EMPATHY_ACCOUNTS_BUS_NAME, G_APPLICATION_FLAGS_NONE);
   app_class = G_OBJECT_GET_CLASS (app);
   G_APPLICATION_CLASS (app_class)->local_command_line = local_cmdline;
   G_APPLICATION_CLASS (app_class)->activate = app_activate;
index 3d3ae80cf7645dacf7f5bc37b9ad0d58338961ed..991904108601398067afb74c89c72777b50fbfd6 100644 (file)
@@ -31,6 +31,7 @@
 #include <X11/Xlib.h>
 #endif
 
+#include "empathy-bus-names.h"
 #include "empathy-call-factory.h"
 #include "empathy-call-window.h"
 #include "empathy-ui-utils.h"
@@ -41,8 +42,6 @@
 /* Exit after $TIMEOUT seconds if not displaying any call window */
 #define TIMEOUT 60
 
-#define EMPATHY_CALL_DBUS_NAME "org.gnome.Empathy.Call"
-
 static GtkApplication *app = NULL;
 static gboolean activated = FALSE;
 static gboolean use_timer = TRUE;
@@ -255,7 +254,7 @@ main (int argc,
   g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme",
       TRUE, NULL);
 
-  app = gtk_application_new (EMPATHY_CALL_DBUS_NAME, G_APPLICATION_FLAGS_NONE);
+  app = gtk_application_new (EMPATHY_CALL_BUS_NAME, G_APPLICATION_FLAGS_NONE);
   g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL);
 
 #ifdef ENABLE_DEBUG
index 1c4c57d255965f270543e8b0617a3c7cd574949c..f25acb6575b89f670f3c244b6c621d4d61e2c51c 100644 (file)
@@ -25,6 +25,7 @@
 #include <glib/gi18n.h>
 #include <libnotify/notify.h>
 
+#include "empathy-bus-names.h"
 #include "empathy-chat-manager.h"
 #include "empathy-chat-resources.h"
 #include "empathy-presence-manager.h"
@@ -38,8 +39,6 @@
 /* Exit after $TIMEOUT seconds if not displaying any call window */
 #define TIMEOUT 60
 
-#define EMPATHY_CHAT_DBUS_NAME "org.gnome.Empathy.Chat"
-
 static GtkApplication *app = NULL;
 static gboolean activated = FALSE;
 static gboolean use_timer = TRUE;
@@ -126,7 +125,7 @@ main (int argc,
   resource = empathy_chat_get_resource ();
   g_resources_register (resource);
 
-  app = gtk_application_new (EMPATHY_CHAT_DBUS_NAME, G_APPLICATION_FLAGS_NONE);
+  app = gtk_application_new (EMPATHY_CHAT_BUS_NAME, G_APPLICATION_FLAGS_NONE);
   g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL);
 
 #ifdef ENABLE_DEBUG
index 6b5b82866274535a3b1878d691abe579642c8884..8be2be32cd506cee6ceab62b0f4e7ca25f2efa50 100644 (file)
 
 #include <glib/gi18n.h>
 
+#include "empathy-bus-names.h"
 #include "empathy-debug-window.h"
 #include "empathy-ui-utils.h"
 
-#define EMPATHY_DEBUGGER_DBUS_NAME "org.gnome.Empathy.Debugger"
-
 static GtkWidget *window = NULL;
 static gchar *service = NULL;
 
@@ -134,7 +133,7 @@ main (int argc,
 
   textdomain (GETTEXT_PACKAGE);
 
-  app = gtk_application_new (EMPATHY_DEBUGGER_DBUS_NAME, G_APPLICATION_FLAGS_NONE);
+  app = gtk_application_new (EMPATHY_DEBUGGER_BUS_NAME, G_APPLICATION_FLAGS_NONE);
   app_class = G_APPLICATION_CLASS (G_OBJECT_GET_CLASS (app));
   app_class->local_command_line = local_cmdline;
   app_class->activate = app_activate;
index 0d3c694216a22bdbc6a9e43abde4d7750a3657f5..54b06a83f24271c8e14b4d5eb4de2cc52a2654f7 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "empathy-accounts-common.h"
 #include "empathy-accounts-dialog.h"
+#include "empathy-bus-names.h"
 #include "empathy-chatroom-manager.h"
 #include "empathy-client-factory.h"
 #include "empathy-connection-aggregator.h"
@@ -50,8 +51,6 @@
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
 #include "empathy-debug.h"
 
-#define EMPATHY_DBUS_NAME "org.gnome.Empathy"
-
 #define EMPATHY_TYPE_APP (empathy_app_get_type ())
 #define EMPATHY_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_APP, EmpathyApp))
 #define EMPATHY_APP_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), EMPATHY_TYPE_APP, EmpathyAppClass))
@@ -837,7 +836,7 @@ main (int argc, char *argv[])
   add_empathy_features ();
 
   app = g_object_new (EMPATHY_TYPE_APP,
-      "application-id", EMPATHY_DBUS_NAME,
+      "application-id", EMPATHY_BUS_NAME,
       NULL);
 
   retval = g_application_run (G_APPLICATION (app), argc, argv);