[network-manager-openvpn/lr/multiple-vpn: 2/4] props



commit b5906f572c8414e5bd5cefab6dff966575f0fccc
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Wed Aug 19 11:39:31 2015 +0200

    props

 auth-dialog/main.c               |    4 ++--
 properties/import-export.c       |    2 +-
 properties/nm-openvpn.c          |    4 ++--
 src/nm-openvpn-service-defines.h |    2 ++
 4 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 3f72832..6283b3a 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -492,8 +492,8 @@ main (int argc, char *argv[])
                return EXIT_FAILURE;
        }
 
-       if (strcmp (vpn_service, NM_DBUS_SERVICE_OPENVPN) != 0) {
-               fprintf (stderr, "This dialog only works with the '%s' service\n", NM_DBUS_SERVICE_OPENVPN);
+       if (strcmp (vpn_service, NM_VPN_SERVICE_TYPE_OPENVPN) != 0) {
+               fprintf (stderr, "This dialog only works with the '%s' service\n", 
NM_VPN_SERVICE_TYPE_OPENVPN);
                return EXIT_FAILURE;
        }
 
diff --git a/properties/import-export.c b/properties/import-export.c
index b8aa34f..bca0240 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -320,7 +320,7 @@ do_import (const char *path, char **lines, GError **error)
 
        s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
 
-       g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_DBUS_SERVICE_OPENVPN, NULL);
+       g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_VPN_SERVICE_TYPE_OPENVPN, NULL);
 
        /* Get the default path for ca, cert, key file, these files maybe
         * in same path with the configuration file */
diff --git a/properties/nm-openvpn.c b/properties/nm-openvpn.c
index 7ecfa21..1e9d277 100644
--- a/properties/nm-openvpn.c
+++ b/properties/nm-openvpn.c
@@ -465,7 +465,7 @@ update_connection (NMVpnEditor *iface,
                return FALSE;
 
        s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
-       g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_DBUS_SERVICE_OPENVPN, NULL);
+       g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_VPN_SERVICE_TYPE_OPENVPN, NULL);
 
        /* Gateway */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
@@ -746,7 +746,7 @@ get_property (GObject *object, guint prop_id,
                g_value_set_string (value, OPENVPN_PLUGIN_DESC);
                break;
        case PROP_SERVICE:
-               g_value_set_string (value, NM_DBUS_SERVICE_OPENVPN);
+               g_value_set_string (value, NM_VPN_SERVICE_TYPE_OPENVPN);
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/src/nm-openvpn-service-defines.h b/src/nm-openvpn-service-defines.h
index 7c61218..ad7d193 100644
--- a/src/nm-openvpn-service-defines.h
+++ b/src/nm-openvpn-service-defines.h
@@ -23,6 +23,8 @@
 #ifndef NM_OPENVPN_SERVICE_DEFINES_H
 #define NM_OPENVPN_SERVICE_DEFINES_H
 
+#define NM_VPN_SERVICE_TYPE_OPENVPN "org.freedesktop.NetworkManager.openvpn"
+
 #define NM_DBUS_SERVICE_OPENVPN    "org.freedesktop.NetworkManager.openvpn"
 #define NM_DBUS_INTERFACE_OPENVPN  "org.freedesktop.NetworkManager.openvpn"
 #define NM_DBUS_PATH_OPENVPN       "/org/freedesktop/NetworkManager/openvpn"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]