Commit fd2a787e authored by Jiří Klimeš's avatar Jiří Klimeš
Browse files

core: NMVPNPlugin initialization changed to use GInitable (rh #1050934)

https://bugzilla.redhat.com/show_bug.cgi?id=1050934
parent 738fa8ed
......@@ -57,7 +57,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
IT_PROG_INTLTOOL([0.35])
AM_GLIB_GNU_GETTEXT
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32)
PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.32)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"
......
......@@ -28,6 +28,7 @@
#endif
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib.h>
......@@ -1521,12 +1522,15 @@ NMOpenvpnPlugin *
nm_openvpn_plugin_new (void)
{
NMOpenvpnPlugin *plugin;
plugin = (NMOpenvpnPlugin *) g_object_new (NM_TYPE_OPENVPN_PLUGIN,
NM_VPN_PLUGIN_DBUS_SERVICE_NAME,
NM_DBUS_SERVICE_OPENVPN,
NULL);
if (plugin)
GError *error = NULL;
plugin = g_initable_new (NM_TYPE_OPENVPN_PLUGIN, NULL, &error,
NM_VPN_PLUGIN_DBUS_SERVICE_NAME, NM_DBUS_SERVICE_OPENVPN,
NULL);
if (!plugin) {
g_warning ("%s", error->message);
g_error_free (error);
} else
g_signal_connect (G_OBJECT (plugin), "state-changed", G_CALLBACK (plugin_state_changed), NULL);
return plugin;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment