[network-manager-openconnect/lr/multiple-vpn: 2/4] all: rename some defines
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect/lr/multiple-vpn: 2/4] all: rename some defines
- Date: Fri, 23 Oct 2015 14:45:38 +0000 (UTC)
commit 3dad5733f9b5b1e21ce6b7c33f96df4de1825848
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Tue Oct 13 19:04:42 2015 +0200
all: rename some defines
Don't mix up service name with a bus name. They're technically distinct
and soon will become possibly different.
auth-dialog/main.c | 4 ++--
properties/nm-openconnect.c | 6 +++---
src/nm-openconnect-service-defines.h | 2 ++
src/nm-openconnect-service.c | 2 +-
4 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 9744988..7e28db2 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -1623,9 +1623,9 @@ int main (int argc, char **argv)
return 1;
}
- if (strcmp(vpn_service, NM_DBUS_SERVICE_OPENCONNECT) != 0) {
+ if (strcmp(vpn_service, NM_VPN_SERVICE_TYPE_OPENCONNECT) != 0) {
fprintf (stderr, "This dialog only works with the '%s' service\n",
- NM_DBUS_SERVICE_OPENCONNECT);
+ NM_VPN_SERVICE_TYPE_OPENCONNECT);
return 1;
}
diff --git a/properties/nm-openconnect.c b/properties/nm-openconnect.c
index 24ef4ce..ec1a3e8 100644
--- a/properties/nm-openconnect.c
+++ b/properties/nm-openconnect.c
@@ -165,7 +165,7 @@ import (NMVpnEditorPlugin *iface, const char *path, GError **error)
nm_connection_add_setting (connection, NM_SETTING (s_con));
s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
- g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_DBUS_SERVICE_OPENCONNECT, NULL);
+ g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_VPN_SERVICE_TYPE_OPENCONNECT, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_vpn));
s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
@@ -597,7 +597,7 @@ update_connection (NMVpnEditor *iface,
const char *auth_type = NULL;
s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
- g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_DBUS_SERVICE_OPENCONNECT, NULL);
+ g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_VPN_SERVICE_TYPE_OPENCONNECT, NULL);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
@@ -810,7 +810,7 @@ get_property (GObject *object, guint prop_id,
g_value_set_string (value, OPENCONNECT_PLUGIN_DESC);
break;
case PROP_SERVICE:
- g_value_set_string (value, NM_DBUS_SERVICE_OPENCONNECT);
+ g_value_set_string (value, NM_VPN_SERVICE_TYPE_OPENCONNECT);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/src/nm-openconnect-service-defines.h b/src/nm-openconnect-service-defines.h
index 38ca43f..9366edc 100644
--- a/src/nm-openconnect-service-defines.h
+++ b/src/nm-openconnect-service-defines.h
@@ -25,6 +25,8 @@
#ifndef NM_OPENCONNECT_SERVICE_DEFINES_H
#define NM_OPENCONNECT_SERVICE_DEFINES_H
+#define NM_VPN_SERVICE_TYPE_OPENCONNECT "org.freedesktop.NetworkManager.openconnect"
+
#define NM_DBUS_SERVICE_OPENCONNECT "org.freedesktop.NetworkManager.openconnect"
#define NM_DBUS_INTERFACE_OPENCONNECT "org.freedesktop.NetworkManager.openconnect"
#define NM_DBUS_PATH_OPENCONNECT "/org/freedesktop/NetworkManager/openconnect"
diff --git a/src/nm-openconnect-service.c b/src/nm-openconnect-service.c
index 736c620..b1fe8a8 100644
--- a/src/nm-openconnect-service.c
+++ b/src/nm-openconnect-service.c
@@ -599,7 +599,7 @@ nm_openconnect_plugin_new (void)
GError *error = NULL;
plugin = (NMOpenconnectPlugin *) g_initable_new (NM_TYPE_OPENCONNECT_PLUGIN, NULL, &error,
- NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
NM_DBUS_SERVICE_OPENCONNECT,
+ NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
NM_VPN_SERVICE_TYPE_OPENCONNECT,
NULL);
if (!plugin) {
g_warning ("Failed to initialize a plugin instance: %s", error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]