From: Enlightenment S. <no-...@en...> - 2010-06-01 19:42:36
|
Log: add a define for fdo.properties interface, replace lots of code with #define values Author: discomfitor Date: 2010-06-01 12:42:29 -0700 (Tue, 01 Jun 2010) New Revision: 49379 Modified: trunk/e_dbus/src/lib/bluez/e_bluez.c trunk/e_dbus/src/lib/connman/e_connman.c trunk/e_dbus/src/lib/dbus/E_DBus.h trunk/e_dbus/src/lib/dbus/e_dbus_interfaces.c trunk/e_dbus/src/lib/dbus/e_dbus_methods.c trunk/e_dbus/src/lib/dbus/e_dbus_object.c trunk/e_dbus/src/lib/ofono/e_ofono.c trunk/e_dbus/src/lib/ukit/E_Ukit.h trunk/e_dbus/src/lib/ukit/e_ukit_private.h Modified: trunk/e_dbus/src/lib/bluez/e_bluez.c =================================================================== --- trunk/e_dbus/src/lib/bluez/e_bluez.c 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/bluez/e_bluez.c 2010-06-01 19:42:29 UTC (rev 49379) @@ -8,9 +8,6 @@ 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_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) Modified: trunk/e_dbus/src/lib/connman/e_connman.c =================================================================== --- trunk/e_dbus/src/lib/connman/e_connman.c 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/connman/e_connman.c 2010-06-01 19:42:29 UTC (rev 49379) @@ -8,9 +8,6 @@ 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_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) Modified: trunk/e_dbus/src/lib/dbus/E_DBus.h =================================================================== --- trunk/e_dbus/src/lib/dbus/E_DBus.h 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/dbus/E_DBus.h 2010-06-01 19:42:29 UTC (rev 49379) @@ -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" { Modified: trunk/e_dbus/src/lib/dbus/e_dbus_interfaces.c =================================================================== --- trunk/e_dbus/src/lib/dbus/e_dbus_interfaces.c 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/dbus/e_dbus_interfaces.c 2010-06-01 19:42:29 UTC (rev 49379) @@ -77,7 +77,7 @@ } 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 " Modified: trunk/e_dbus/src/lib/dbus/e_dbus_methods.c =================================================================== --- trunk/e_dbus/src/lib/dbus/e_dbus_methods.c 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/dbus/e_dbus_methods.c 2010-06-01 19:42:29 UTC (rev 49379) @@ -10,7 +10,7 @@ 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", Modified: trunk/e_dbus/src/lib/dbus/e_dbus_object.c =================================================================== --- trunk/e_dbus/src/lib/dbus/e_dbus_object.c 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/dbus/e_dbus_object.c 2010-06-01 19:42:29 UTC (rev 49379) @@ -180,7 +180,7 @@ 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); Modified: trunk/e_dbus/src/lib/ofono/e_ofono.c =================================================================== --- trunk/e_dbus/src/lib/ofono/e_ofono.c 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/ofono/e_ofono.c 2010-06-01 19:42:29 UTC (rev 49379) @@ -8,9 +8,6 @@ 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_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) Modified: trunk/e_dbus/src/lib/ukit/E_Ukit.h =================================================================== --- trunk/e_dbus/src/lib/ukit/E_Ukit.h 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/ukit/E_Ukit.h 2010-06-01 19:42:29 UTC (rev 49379) @@ -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" Modified: trunk/e_dbus/src/lib/ukit/e_ukit_private.h =================================================================== --- trunk/e_dbus/src/lib/ukit/e_ukit_private.h 2010-06-01 19:39:00 UTC (rev 49378) +++ trunk/e_dbus/src/lib/ukit/e_ukit_private.h 2010-06-01 19:42:29 UTC (rev 49379) @@ -25,7 +25,7 @@ #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__) |