[network-manager-openconnect: 7/15] shared: use "nm-default.h" header



commit 2acd41b10d30368eddee779a8632fe4720b93813
Author: Thomas Haller <thaller redhat com>
Date:   Thu Jun 16 17:15:43 2016 +0200

    shared: use "nm-default.h" header

 auth-dialog/main.c                              |   10 +------
 properties/Makefile.am                          |    3 +-
 properties/auth-helpers.c                       |   10 ++-----
 properties/auth-helpers.h                       |    9 ------
 properties/nm-openconnect.c                     |   32 ++--------------------
 properties/nm-openconnect.h                     |    4 +--
 src/nm-openconnect-service-openconnect-helper.c |    7 +---
 src/nm-openconnect-service.c                    |   10 ++-----
 src/nm-openconnect-service.h                    |    6 ----
 9 files changed, 15 insertions(+), 76 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 4f31ee6..a03aae8 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -23,9 +23,7 @@
  *   Boston, MA 02110-1301 USA
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "nm-default.h"
 
 #include <string.h>
 #include <errno.h>
@@ -37,17 +35,11 @@
 #include <libxml/tree.h>
 
 #include <gtk/gtk.h>
-#include <glib/gi18n.h>
 #include <glib-unix.h>
 
-#include <NetworkManager.h>
-#include <nm-vpn-service-plugin.h>
-
 #define SECRET_API_SUBJECT_TO_CHANGE
 #include <libsecret/secret.h>
 
-#include "nm-service-defines.h"
-
 #include "openconnect.h"
 
 #if !OPENCONNECT_CHECK_VER(2,1)
diff --git a/properties/Makefile.am b/properties/Makefile.am
index 5809f31..a7b2d8e 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -19,7 +19,6 @@ common_CFLAGS = \
        $(GTK_CFLAGS) \
        $(OPENCONNECT_CFLAGS) \
        -I$(top_srcdir)/shared \
-       -I$(top_srcdir)/src \
        -DICONDIR=\""$(datadir)/pixmaps"\" \
        -DUIDIR=\""$(uidir)"\" \
        -DLOCALEDIR=\"$(datadir)/locale\"
@@ -30,6 +29,7 @@ libnm_vpn_plugin_openconnect_la_SOURCES = \
        $(plugin_sources)
 
 libnm_vpn_plugin_openconnect_la_CFLAGS = \
+       -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
        $(common_CFLAGS) \
        $(LIBNM_CFLAGS)
 
@@ -48,6 +48,7 @@ libnm_openconnect_properties_la_SOURCES = \
 
 libnm_openconnect_properties_la_CFLAGS = \
        -DNM_VPN_OLD \
+       -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
        $(common_CFLAGS) \
        $(LIBNM_GLIB_CFLAGS)
 
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 5fa3384..e60d16f 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -21,9 +21,9 @@
  *
  **************************************************************************/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "nm-default.h"
+
+#include "auth-helpers.h"
 
 #include <string.h>
 #include <sys/types.h>
@@ -33,11 +33,7 @@
 #include <unistd.h>
 #include <errno.h>
 
-#include <glib/gi18n-lib.h>
-
-#include "auth-helpers.h"
 #include "nm-openconnect.h"
-#include "nm-service-defines.h"
 
 void
 tls_pw_init_auth_widget (GtkBuilder *builder,
diff --git a/properties/auth-helpers.h b/properties/auth-helpers.h
index 4f754ed..1175c9b 100644
--- a/properties/auth-helpers.h
+++ b/properties/auth-helpers.h
@@ -23,17 +23,8 @@
 #ifndef _AUTH_HELPERS_H_
 #define _AUTH_HELPERS_H_
 
-#include <glib.h>
 #include <gtk/gtk.h>
 
-#ifdef NM_VPN_OLD
-#define NM_VPN_LIBNM_COMPAT
-#include <nm-connection.h>
-#include <nm-setting-vpn.h>
-#else /* !NM_VPN_OLD */
-#include <NetworkManager.h>
-#endif
-
 typedef void (*ChangedCallback) (GtkWidget *widget, gpointer user_data);
 
 void tls_pw_init_auth_widget (GtkBuilder *builder,
diff --git a/properties/nm-openconnect.c b/properties/nm-openconnect.c
index 15f550b..7551785 100644
--- a/properties/nm-openconnect.c
+++ b/properties/nm-openconnect.c
@@ -24,15 +24,14 @@
  *
  **************************************************************************/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "nm-default.h"
+
+#include "nm-openconnect.h"
 
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
 #include <stdlib.h>
-#include <glib/gi18n-lib.h>
 #include <string.h>
 #include <gtk/gtk.h>
 
@@ -49,31 +48,6 @@
 #define openconnect_has_oath_support() 0
 #endif
 
-#ifdef NM_VPN_OLD
-#define NM_VPN_LIBNM_COMPAT
-#include <nm-vpn-plugin-ui-interface.h>
-#include <nm-setting-vpn.h>
-#include <nm-setting-connection.h>
-#include <nm-setting-ip4-config.h>
-
-#define nm_simple_connection_new nm_connection_new
-
-#define NMV_EDITOR_PLUGIN_ERROR                   NM_SETTING_VPN_ERROR
-#define NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY  NM_SETTING_VPN_ERROR_INVALID_PROPERTY
-
-#define NMV_EDITOR_PLUGIN_ERROR                   NM_SETTING_VPN_ERROR
-#define NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY  NM_SETTING_VPN_ERROR_INVALID_PROPERTY
-
-#else /* !NM_VPN_OLD */
-
-#include <NetworkManager.h>
-
-#define NMV_EDITOR_PLUGIN_ERROR                   NM_CONNECTION_ERROR
-#define NMV_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY  NM_CONNECTION_ERROR_INVALID_PROPERTY
-#endif
-
-#include "nm-service-defines.h"
-#include "nm-openconnect.h"
 #include "auth-helpers.h"
 
 #ifndef NM_VPN_OLD
diff --git a/properties/nm-openconnect.h b/properties/nm-openconnect.h
index f8c2b9d..a392b73 100644
--- a/properties/nm-openconnect.h
+++ b/properties/nm-openconnect.h
@@ -23,8 +23,6 @@
 #ifndef _NM_OPENCONNECT_H_
 #define _NM_OPENCONNECT_H_
 
-#include <glib-object.h>
-
 #define OPENCONNECT_TYPE_EDITOR_PLUGIN            (openconnect_editor_plugin_get_type ())
 #define OPENCONNECT_EDITOR_PLUGIN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
OPENCONNECT_TYPE_EDITOR_PLUGIN, OpenconnectEditorPlugin))
 #define OPENCONNECT_EDITOR_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), 
OPENCONNECT_TYPE_EDITOR_PLUGIN, OpenconnectEditorPluginClass))
@@ -66,5 +64,5 @@ struct _OpenconnectEditorClass {
 
 GType openconnect_editor_get_type (void);
 
-#endif /* _NM_OPENCONNECT_H_ */
+#endif /* _NM_OPENCONNECT_H_ */
 
diff --git a/src/nm-openconnect-service-openconnect-helper.c b/src/nm-openconnect-service-openconnect-helper.c
index 11da4f3..f4ef10c 100644
--- a/src/nm-openconnect-service-openconnect-helper.c
+++ b/src/nm-openconnect-service-openconnect-helper.c
@@ -22,7 +22,8 @@
  *   Copyright © 2007 - 2008 Novell, Inc.
  */
 
-#include <glib.h>
+#include "nm-default.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -30,10 +31,6 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
-#include <NetworkManager.h>
-
-#include "nm-openconnect-service.h"
-#include "nm-utils.h"
 
 static void
 helper_failed (GDBusProxy *proxy, const char *reason)
diff --git a/src/nm-openconnect-service.c b/src/nm-openconnect-service.c
index 4fccba2..f3e0f05 100644
--- a/src/nm-openconnect-service.c
+++ b/src/nm-openconnect-service.c
@@ -22,9 +22,9 @@
  *   Copyright © 2007 - 2008 Novell, Inc.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "nm-default.h"
+
+#include "nm-openconnect-service.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -41,10 +41,6 @@
 #include <pwd.h>
 #include <grp.h>
 #include <locale.h>
-#include <glib/gi18n.h>
-
-#include "nm-openconnect-service.h"
-#include "nm-utils.h"
 
 #if !defined(DIST_VERSION)
 # define DIST_VERSION VERSION
diff --git a/src/nm-openconnect-service.h b/src/nm-openconnect-service.h
index a674843..14bab5c 100644
--- a/src/nm-openconnect-service.h
+++ b/src/nm-openconnect-service.h
@@ -25,12 +25,6 @@
 #ifndef NM_OPENCONNECT_PLUGIN_H
 #define NM_OPENCONNECT_PLUGIN_H
 
-#include <glib.h>
-#include <NetworkManager.h>
-#include <nm-vpn-service-plugin.h>
-
-#include "nm-service-defines.h"
-
 #define NM_TYPE_OPENCONNECT_PLUGIN            (nm_openconnect_plugin_get_type ())
 #define NM_OPENCONNECT_PLUGIN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
NM_TYPE_OPENCONNECT_PLUGIN, NMOpenconnectPlugin))
 #define NM_OPENCONNECT_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_OPENCONNECT_PLUGIN, 
NMOpenconnectPluginClass))


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