summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Winship <danw@redhat.com>2015-04-13 10:28:17 -0400
committerDan Winship <danw@redhat.com>2015-07-24 13:25:47 -0400
commitdd0e19895532504e6de615d18a761457ec685b58 (patch)
tree5df8230a545e0bd0fe6be3835962ddcdff00a088 /src
parentf2174b623f814115207331f4ad0d3e944d1f323b (diff)
downloadNetworkManager-dd0e19895532504e6de615d18a761457ec685b58.tar.gz
include: add nm-dbus-compat.h
Add a file containing the defines like DBUS_INTERFACE_DBUS from dbus-shared.h, and use it from the gdbus-using files. Also, convert a bunch of other places that were previously hardcoding the string values to use the defines instead, and fix the ifcfg-rh plugin to properly namespace its own D-Bus-related defines.
Diffstat (limited to 'src')
-rw-r--r--src/devices/team/nm-device-team.c6
-rw-r--r--src/devices/wwan/nm-modem-manager.c2
-rw-r--r--src/nm-dbus-manager.c6
-rw-r--r--src/settings/plugins/ifcfg-rh/plugin.c17
-rw-r--r--src/supplicant-manager/nm-supplicant-interface.c5
5 files changed, 18 insertions, 18 deletions
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c
index 23750f3579..ccfab0f3b0 100644
--- a/src/devices/team/nm-device-team.c
+++ b/src/devices/team/nm-device-team.c
@@ -332,9 +332,9 @@ teamd_dbus_appeared (GDBusConnection *connection,
guint32 pid;
ret = g_dbus_connection_call_sync (connection,
- "org.freedesktop.DBus",
- "/org/freedesktop/DBus",
- "org.freedesktop.DBus",
+ DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS,
"GetConnectionUnixProcessID",
g_variant_new ("(s)", name_owner),
NULL,
diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c
index f0e5692651..92ac0a189c 100644
--- a/src/devices/wwan/nm-modem-manager.c
+++ b/src/devices/wwan/nm-modem-manager.c
@@ -265,7 +265,7 @@ modem_manager_poke (NMModemManager *self)
g_dbus_connection_call (self->priv->dbus_connection,
"org.freedesktop.ModemManager1",
"/org/freedesktop/ModemManager1",
- "org.freedesktop.DBus.Peer",
+ DBUS_INTERFACE_PEER,
"Ping",
NULL, /* inputs */
NULL, /* outputs */
diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c
index b8b5325671..4f3ea07223 100644
--- a/src/nm-dbus-manager.c
+++ b/src/nm-dbus-manager.c
@@ -769,9 +769,9 @@ nm_dbus_manager_init_bus (NMDBusManager *self)
dbus_connection_set_exit_on_disconnect (priv->connection, FALSE);
priv->proxy = dbus_g_proxy_new_for_name (priv->g_connection,
- "org.freedesktop.DBus",
- "/org/freedesktop/DBus",
- "org.freedesktop.DBus");
+ DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS);
priv->proxy_destroy_id = g_signal_connect (priv->proxy, "destroy",
G_CALLBACK (destroy_cb), self);
diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c
index 8febfe6a01..d33b41cd0c 100644
--- a/src/settings/plugins/ifcfg-rh/plugin.c
+++ b/src/settings/plugins/ifcfg-rh/plugin.c
@@ -59,9 +59,8 @@
#include "utils.h"
#include "gsystem-local-alloc.h"
-#define DBUS_SERVICE_NAME "com.redhat.ifcfgrh1"
-#define DBUS_OBJECT_PATH "/com/redhat/ifcfgrh1"
-
+#define IFCFGRH1_DBUS_SERVICE_NAME "com.redhat.ifcfgrh1"
+#define IFCFGRH1_DBUS_OBJECT_PATH "/com/redhat/ifcfgrh1"
#define _LOG_DEFAULT_DOMAIN LOGD_SETTINGS
@@ -792,12 +791,12 @@ sc_plugin_ifcfg_init (SCPluginIfcfg *plugin)
dbus_connection_set_exit_on_disconnect (tmp, FALSE);
proxy = dbus_g_proxy_new_for_name (priv->bus,
- "org.freedesktop.DBus",
- "/org/freedesktop/DBus",
- "org.freedesktop.DBus");
+ DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS);
if (!dbus_g_proxy_call (proxy, "RequestName", &error,
- G_TYPE_STRING, DBUS_SERVICE_NAME,
+ G_TYPE_STRING, IFCFGRH1_DBUS_SERVICE_NAME,
G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE,
G_TYPE_INVALID,
G_TYPE_UINT, &result,
@@ -927,9 +926,9 @@ nm_system_config_factory (void)
priv = SC_PLUGIN_IFCFG_GET_PRIVATE (singleton);
if (priv->bus)
dbus_g_connection_register_g_object (priv->bus,
- DBUS_OBJECT_PATH,
+ IFCFGRH1_DBUS_OBJECT_PATH,
G_OBJECT (singleton));
- _LOGD ("Acquired D-Bus service %s", DBUS_SERVICE_NAME);
+ _LOGD ("Acquired D-Bus service %s", IFCFGRH1_DBUS_SERVICE_NAME);
} else
g_object_ref (singleton);
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c
index 19795bf3b9..d2361f51e6 100644
--- a/src/supplicant-manager/nm-supplicant-interface.c
+++ b/src/supplicant-manager/nm-supplicant-interface.c
@@ -32,6 +32,7 @@
#include "nm-glib-compat.h"
#include "gsystem-local-alloc.h"
#include "nm-core-internal.h"
+#include "nm-dbus-compat.h"
#define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface"
#define WPAS_DBUS_IFACE_BSS WPAS_DBUS_INTERFACE ".BSS"
@@ -691,7 +692,7 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_
*/
priv->ready_count++;
g_dbus_proxy_call (priv->iface_proxy,
- "org.freedesktop.DBus.Introspectable.Introspect",
+ DBUS_INTERFACE_INTROSPECTABLE ".Introspect",
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
@@ -1133,7 +1134,7 @@ nm_supplicant_interface_set_config (NMSupplicantInterface *self,
if (cfg) {
priv->cfg = g_object_ref (cfg);
g_dbus_proxy_call (priv->iface_proxy,
- "org.freedesktop.DBus.Properties.Set",
+ DBUS_INTERFACE_PROPERTIES ".Set",
g_variant_new ("(ssv)",
WPAS_DBUS_IFACE_INTERFACE,
"ApScan",