[network-manager-fortisslvpn] service: the plugin is initable



commit a2d34a173c58229f1986516357ace27257c3f260
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Sep 28 11:12:26 2015 +0200

    service: the plugin is initable

 src/nm-fortisslvpn-service.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/nm-fortisslvpn-service.c b/src/nm-fortisslvpn-service.c
index 7fc5806..f94f079 100644
--- a/src/nm-fortisslvpn-service.c
+++ b/src/nm-fortisslvpn-service.c
@@ -946,13 +946,19 @@ NMFortisslvpnPlugin *
 nm_fortisslvpn_plugin_new (void)
 {
        NMFortisslvpnPlugin *plugin;
+       GError *error = NULL;
 
-       plugin = g_object_new (NM_TYPE_FORTISSLVPN_PLUGIN,
-                              NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
-                              NM_DBUS_SERVICE_FORTISSLVPN,
-                              NULL);
-       if (plugin)
+       plugin = (NMFortisslvpnPlugin *) g_initable_new (NM_TYPE_FORTISSLVPN_PLUGIN, NULL, &error,
+                                                        NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
+                                                        NM_DBUS_SERVICE_FORTISSLVPN,
+                                                        NULL);
+       if (plugin) {
                g_signal_connect (G_OBJECT (plugin), "state-changed", G_CALLBACK (state_changed_cb), NULL);
+       } else {
+               g_warning ("Failed to initialize a plugin instance: %s", error->message);
+               g_error_free (error);
+       }
+
        return plugin;
 }
 


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