[network-manager-openvpn/lr/libnm: 8/15] fixup! service: port to libnm
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/lr/libnm: 8/15] fixup! service: port to libnm
- Date: Wed, 19 Aug 2015 16:41:30 +0000 (UTC)
commit add39ff75b3496f55390f07f9c3f0cb9c66ea559
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Fri Aug 14 18:06:47 2015 +0200
fixup! service: port to libnm
Initialize a GInitable.
src/nm-openvpn-service.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 17a2412..f392515 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1626,13 +1626,19 @@ NMOpenvpnPlugin *
nm_openvpn_plugin_new (void)
{
NMOpenvpnPlugin *plugin;
+ GError *error = NULL;
- plugin = (NMOpenvpnPlugin *) g_object_new (NM_TYPE_OPENVPN_PLUGIN,
- NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
- NM_DBUS_SERVICE_OPENVPN,
- NULL);
- if (plugin)
+ plugin = (NMOpenvpnPlugin *) g_initable_new (NM_TYPE_OPENVPN_PLUGIN, NULL, &error,
+ NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME,
+ NM_DBUS_SERVICE_OPENVPN,
+ NULL);
+
+ if (plugin) {
g_signal_connect (G_OBJECT (plugin), "state-changed", G_CALLBACK (plugin_state_changed),
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]