[network-manager-vpnc/lr/libnm: 6/10] fixup! service: port to libnm



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

    fixup! service: port to libnm
    
    Initialize a GInitable.

 src/nm-vpnc-service.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/nm-vpnc-service.c b/src/nm-vpnc-service.c
index db36f03..e78ab9d 100644
--- a/src/nm-vpnc-service.c
+++ b/src/nm-vpnc-service.c
@@ -1086,10 +1086,19 @@ nm_vpnc_plugin_class_init (NMVPNCPluginClass *vpnc_class)
 NMVPNCPlugin *
 nm_vpnc_plugin_new (void)
 {
-       return (NMVPNCPlugin *) g_object_new (NM_TYPE_VPNC_PLUGIN,
-                                             NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
-                                             NM_DBUS_SERVICE_VPNC,
-                                             NULL);
+       NMVPNCPlugin *plugin;
+       GError *error = NULL;
+
+       plugin = (NMVPNCPlugin *) g_initable_new (NM_TYPE_VPNC_PLUGIN, NULL, &error,
+                                                 NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
+                                                 NM_DBUS_SERVICE_VPNC,
+                                                 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]