[network-manager-fortisslvpn] properties: use the NM error types & quarks



commit 62446846ecefed480215097c984943c8ca64181f
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Sep 25 18:45:37 2015 +0200

    properties: use the NM error types & quarks

 properties/nm-fortisslvpn.c |   39 ++++++---------------------------------
 properties/nm-fortisslvpn.h |   13 -------------
 2 files changed, 6 insertions(+), 46 deletions(-)
---
diff --git a/properties/nm-fortisslvpn.c b/properties/nm-fortisslvpn.c
index cb9ef60..739bd85 100644
--- a/properties/nm-fortisslvpn.c
+++ b/properties/nm-fortisslvpn.c
@@ -43,6 +43,9 @@
 #include <nm-setting-ip4-config.h>
 #include <nm-ui-utils.h>
 
+#define FORTISSLVPN_PLUGIN_UI_ERROR                     NM_SETTING_VPN_ERROR
+#define FORTISSLVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY    NM_SETTING_VPN_ERROR_INVALID_PROPERTY
+
 #define nm_simple_connection_new nm_connection_new
 
 #else /* !NM_OPENVPN_OLD */
@@ -50,6 +53,9 @@
 #include <NetworkManager.h>
 #include <nma-ui-utils.h>
 
+#define FORTISSLVPN_PLUGIN_UI_ERROR                     NM_CONNECTION_ERROR
+#define FORTISSLVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY    NM_CONNECTION_ERROR_INVALID_PROPERTY
+
 #endif
 
 #include "src/nm-fortisslvpn-service-defines.h"
@@ -96,39 +102,6 @@ typedef struct {
        gchar *trusted_cert;
 } FortisslvpnPluginUiWidgetPrivate;
 
-
-GQuark
-fortisslvpn_plugin_ui_error_quark (void)
-{
-       static GQuark error_quark = 0;
-
-       if (G_UNLIKELY (error_quark == 0))
-               error_quark = g_quark_from_static_string ("fortisslvpn-plugin-ui-error-quark");
-
-       return error_quark;
-}
-
-/* This should really be standard. */
-#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
-
-GType
-fortisslvpn_plugin_ui_error_get_type (void)
-{
-       static GType etype = 0;
-
-       if (etype == 0) {
-               static const GEnumValue values[] = {
-                       /* Unknown error. */
-                       ENUM_ENTRY (FORTISSLVPN_PLUGIN_UI_ERROR_UNKNOWN, "UnknownError"),
-                       /* The specified property was invalid. */
-                       ENUM_ENTRY (FORTISSLVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY, "InvalidProperty"),
-                       { 0, 0, 0 }
-               };
-               etype = g_enum_register_static ("FortisslvpnPluginUiError", values);
-       }
-       return etype;
-}
-
 static gboolean
 check_validity (FortisslvpnPluginUiWidget *self, GError **error)
 {
diff --git a/properties/nm-fortisslvpn.h b/properties/nm-fortisslvpn.h
index 25d084a..4c4f441 100644
--- a/properties/nm-fortisslvpn.h
+++ b/properties/nm-fortisslvpn.h
@@ -25,19 +25,6 @@
 
 #include <glib-object.h>
 
-typedef enum
-{
-       FORTISSLVPN_PLUGIN_UI_ERROR_UNKNOWN = 0,
-       FORTISSLVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
-} FortisslvpnPluginUiError;
-
-#define FORTISSLVPN_TYPE_PLUGIN_UI_ERROR (fortisslvpn_plugin_ui_error_get_type ()) 
-GType fortisslvpn_plugin_ui_error_get_type (void);
-
-#define FORTISSLVPN_PLUGIN_UI_ERROR (fortisslvpn_plugin_ui_error_quark ())
-GQuark fortisslvpn_plugin_ui_error_quark (void);
-
-
 #define FORTISSLVPN_TYPE_PLUGIN_UI            (fortisslvpn_plugin_ui_get_type ())
 #define FORTISSLVPN_PLUGIN_UI(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
FORTISSLVPN_TYPE_PLUGIN_UI, FortisslvpnPluginUi))
 #define FORTISSLVPN_PLUGIN_UI_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), FORTISSLVPN_TYPE_PLUGIN_UI, 
FortisslvpnPluginUiClass))


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