[network-manager-pptp/jk/pptp-plugin-init] core: NMVPNPlugin initialization changed to use GInitable (rh #1050934)



commit 79d17b110bdaa316c3034aaac9703423e74b6a7d
Author: Jiří Klimeš <jklimes redhat com>
Date:   Mon Mar 17 17:23:43 2014 +0100

    core: NMVPNPlugin initialization changed to use GInitable (rh #1050934)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1050934

 configure.ac          |    2 +-
 src/nm-pptp-service.c |   19 ++++++++++++-------
 2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b134284..a166836 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,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"
diff --git a/src/nm-pptp-service.c b/src/nm-pptp-service.c
index bca3e28..dd8c963 100644
--- a/src/nm-pptp-service.c
+++ b/src/nm-pptp-service.c
@@ -17,7 +17,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2008 - 2011 Red Hat, Inc.
+ * (C) Copyright 2008 - 2014 Red Hat, Inc.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -44,6 +44,7 @@
 #include <netdb.h>
 
 #include <glib/gi18n.h>
+#include <gio/gio.h>
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib.h>
 
@@ -1284,13 +1285,17 @@ NMPptpPlugin *
 nm_pptp_plugin_new (void)
 {
        NMPptpPlugin *plugin;
-
-       plugin = g_object_new (NM_TYPE_PPTP_PLUGIN,
-                              NM_VPN_PLUGIN_DBUS_SERVICE_NAME,
-                              NM_DBUS_SERVICE_PPTP,
-                              NULL);
-       if (plugin)
+       GError *error = NULL;
+
+       plugin = g_initable_new (NM_TYPE_PPTP_PLUGIN, NULL, &error,
+                                NM_VPN_PLUGIN_DBUS_SERVICE_NAME, NM_DBUS_SERVICE_PPTP,
+                                NULL);
+       if (!plugin) {
+               g_warning ("%s", error->message);
+               g_error_free (error);
+       } else
                g_signal_connect (G_OBJECT (plugin), "state-changed", G_CALLBACK (state_changed_cb), NULL);
+
        return plugin;
 }
 


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