add a define for fdo.properties interface, replace lots of code with #define values
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 1 Jun 2010 19:42:29 +0000 (19:42 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 1 Jun 2010 19:42:29 +0000 (19:42 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@49379 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/bluez/e_bluez.c
src/lib/connman/e_connman.c
src/lib/dbus/E_DBus.h
src/lib/dbus/e_dbus_interfaces.c
src/lib/dbus/e_dbus_methods.c
src/lib/dbus/e_dbus_object.c
src/lib/ofono/e_ofono.c
src/lib/ukit/E_Ukit.h
src/lib/ukit/e_ukit_private.h

index 9014da3..c327ce2 100644 (file)
@@ -8,9 +8,6 @@ static unsigned int init_count = 0;
 static char *unique_name = NULL;
 
 static const char bus_name[] = "org.bluez";
-static const char fdo_bus_name[] = "org.freedesktop.DBus";
-static const char fdo_interface[] = "org.freedesktop.DBus";
-static const char fdo_path[] = "/org/freedesktop/DBus";
 
 E_DBus_Connection *e_bluez_conn = NULL;
 
@@ -279,7 +276,7 @@ e_bluez_system_init(E_DBus_Connection *edbus_conn)
 
    e_bluez_conn = edbus_conn;
    cb_name_owner_changed = e_dbus_signal_handler_add
-     (e_bluez_conn, fdo_bus_name, fdo_path, fdo_interface, "NameOwnerChanged",
+     (e_bluez_conn, E_DBUS_FDO_BUS, E_DBUS_FDO_PATH, E_DBUS_FDO_INTERFACE, "NameOwnerChanged",
       _e_bluez_system_name_owner_changed, NULL);
 
    if (pending_get_name_owner)
index d4fc128..ff23190 100644 (file)
@@ -8,9 +8,6 @@ static unsigned int init_count = 0;
 static char *unique_name = NULL;
 
 static const char bus_name[] = "org.moblin.connman";
-static const char fdo_bus_name[] = "org.freedesktop.DBus";
-static const char fdo_interface[] = "org.freedesktop.DBus";
-static const char fdo_path[] = "/org/freedesktop/DBus";
 
 E_DBus_Connection *e_connman_conn = NULL;
 
@@ -405,7 +402,7 @@ e_connman_system_init(E_DBus_Connection *edbus_conn)
 
    e_connman_conn = edbus_conn;
    cb_name_owner_changed = e_dbus_signal_handler_add
-     (e_connman_conn, fdo_bus_name, fdo_path, fdo_interface, "NameOwnerChanged",
+     (e_connman_conn, E_DBUS_FDO_BUS, E_DBUS_FDO_PATH, E_DBUS_FDO_INTERFACE, "NameOwnerChanged",
       _e_connman_system_name_owner_changed, NULL);
 
    if (pending_get_name_owner)
index 14892c0..6d630f8 100644 (file)
@@ -94,6 +94,7 @@
 #define E_DBUS_FDO_BUS "org.freedesktop.DBus"
 #define E_DBUS_FDO_PATH "/org/freedesktop/DBus"
 #define E_DBUS_FDO_INTERFACE E_DBUS_FDO_BUS
+#define E_DBUS_FDO_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
 
 #ifdef __cplusplus
 extern "C" {
index 5cdb749..fe418f9 100644 (file)
@@ -77,7 +77,7 @@ _dbus_message_property_method_call(E_DBus_Connection *conn, const char *method_n
     }
 
   msg = dbus_message_new_method_call
-    (destination, path, "org.freedesktop.DBus.Properties", method_name);
+    (destination, path, E_DBUS_FDO_INTERFACE_PROPERTIES, method_name);
   if (!msg)
     {
       ERR("E-dbus Error: failed to create message for method call: %s() at "
index 91283a8..3a61766 100644 (file)
@@ -10,7 +10,7 @@ _dbus_message_method_call(const char *method_name)
    DBusMessage *msg;
 
    msg = dbus_message_new_method_call
-     ("org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus",
+     (E_DBUS_FDO_BUS, E_DBUS_FDO_PATH, E_DBUS_FDO_INTERFACE,
       method_name);
    if (!msg)
      ERR("E-dbus Error: failed to create message for method call: %s",
index a2dc920..6158a1b 100644 (file)
@@ -180,7 +180,7 @@ int
 e_dbus_object_init(void)
 {
   introspectable_interface = e_dbus_interface_new("org.freedesktop.DBus.Introspectable");
-  properties_interface = e_dbus_interface_new("org.freedesktop.DBus.Properties");
+  properties_interface = e_dbus_interface_new(E_DBUS_FDO_INTERFACE_PROPERTIES);
   if (!introspectable_interface || !properties_interface)
   {
     if (introspectable_interface) e_dbus_interface_unref(introspectable_interface);
index 8ca58b3..7ccf98a 100644 (file)
@@ -8,9 +8,6 @@ static unsigned int init_count = 0;
 static char *unique_name = NULL;
 
 static const char bus_name[] = "org.ofono";
-static const char fdo_bus_name[] = "org.freedesktop.DBus";
-static const char fdo_interface[] = "org.freedesktop.DBus";
-static const char fdo_path[] = "/org/freedesktop/DBus";
 
 E_DBus_Connection *e_ofono_conn = NULL;
 
@@ -259,7 +256,7 @@ e_ofono_system_init(E_DBus_Connection *edbus_conn)
 
    e_ofono_conn = edbus_conn;
    cb_name_owner_changed = e_dbus_signal_handler_add
-     (e_ofono_conn, fdo_bus_name, fdo_path, fdo_interface, "NameOwnerChanged",
+     (e_ofono_conn, E_DBUS_FDO_BUS, E_DBUS_FDO_PATH, E_DBUS_FDO_INTERFACE, "NameOwnerChanged",
       _e_ofono_system_name_owner_changed, NULL);
 
    if (pending_get_name_owner)
index d15f375..e76d909 100644 (file)
@@ -32,8 +32,6 @@
  * @{
  */
 
-#define E_UKIT_PROP_INTERFACE "org.freedesktop.DBus.Properties"
-
 #define E_UDISKS_BUS "org.freedesktop.UDisks"
 #define E_UDISKS_PATH "/org/freedesktop/UDisks"
 #define E_UDISKS_INTERFACE "org.freedesktop.UDisks.Device"
index c4763de..c25ee67 100644 (file)
@@ -25,7 +25,7 @@ extern int _e_dbus_ukit_log_dom;
 
 #define e_ukit_call_new(udi, member) dbus_message_new_method_call(E_UKIT_BUS, udi, E_UKIT_BUS, member)
 #define e_ukit_device_call_new(udi, member) dbus_message_new_method_call(E_UKIT_BUS, udi, E_UKIT_INTERFACE, member)
-#define e_ukit_property_call_new(udi, member) dbus_message_new_method_call(E_UKIT_BUS, udi, E_UKIT_PROP_INTERFACE, member)
+#define e_ukit_property_call_new(udi, member) dbus_message_new_method_call(E_UKIT_BUS, udi, E_DBUS_FDO_INTERFACE_PROPERTIES, member)
 
 #define DBG(...)   EINA_LOG_DOM_DBG(_e_dbus_ukit_log_dom, __VA_ARGS__)
 #define INFO(...)    EINA_LOG_DOM_INFO(_e_dbus_ukit_log_dom, __VA_ARGS__)