[network-manager-openconnect/lr/libnm: 8/9] fixup! service: port to libnm



commit cf17eedb6b24239f1cefa8d492852ca4bdb189b1
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Aug 14 18:06:11 2015 +0200

    fixup! service: port to libnm
    
    Initialize a GInitable.

 src/nm-openconnect-service.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-openconnect-service.c b/src/nm-openconnect-service.c
index 91e3713..80c6131 100644
--- a/src/nm-openconnect-service.c
+++ b/src/nm-openconnect-service.c
@@ -596,9 +596,18 @@ nm_openconnect_plugin_class_init (NMOpenconnectPluginClass *openconnect_class)
 NMOpenconnectPlugin *
 nm_openconnect_plugin_new (void)
 {
-       return (NMOpenconnectPlugin *) g_object_new (NM_TYPE_OPENCONNECT_PLUGIN,
-                                                    NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME, 
NM_DBUS_SERVICE_OPENCONNECT,
-                                                    NULL);
+       NMOpenconnectPlugin *plugin;
+       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,
+                                                        NULL);
+       if (!plugin) {
+               g_warning ("Failed to initialize a plugin instance: %s", error->message);
+               g_error_free (error);
+       }
+
+       return plugin;
 }
 
 static void


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