Commit 3452ee2a authored by Dan Winship's avatar Dan Winship

all: rename nm-glib-compat.h to nm-glib.h, use everywhere

Rather than randomly including one or more of <glib.h>,
<glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include
"nm-glib-compat.h" most of the time), rename nm-glib-compat.h to
nm-glib.h, include <gio/gio.h> from there, and then change all .c
files in NM to include "nm-glib.h" rather than including the glib
headers directly.

(Public headers files still have to include the real glib headers,
since nm-glib.h isn't installed...)

Also, remove glib includes from header files that are already
including a base object header file (which must itself already include
the glib headers).
parent dd0e1989
......@@ -22,7 +22,6 @@
#include <string.h>
#include <glib-object.h>
#include <nm-dbus-interface.h>
#include <nm-connection.h>
......@@ -30,6 +29,7 @@
#include <nm-setting-ip6-config.h>
#include <nm-setting-connection.h>
#include "nm-glib.h"
#include "nm-dispatcher-api.h"
#include "nm-utils.h"
......
......@@ -21,7 +21,7 @@
#ifndef __NETWORKMANAGER_DISPATCHER_UTILS_H__
#define __NETWORKMANAGER_DISPATCHER_UTILS_H__
#include <glib.h>
#include "nm-glib.h"
char **
nm_dispatcher_utils_construct_envp (const char *action,
......
......@@ -32,13 +32,11 @@
#include <errno.h>
#include <arpa/inet.h>
#include <glib.h>
#include <glib-unix.h>
#include "nm-glib.h"
#include "nm-dispatcher-api.h"
#include "nm-dispatcher-utils.h"
#include "nm-glib-compat.h"
#include "nmdbus-dispatcher.h"
......
......@@ -23,9 +23,8 @@
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include "nm-glib.h"
#include "nm-core-internal.h"
#include "nm-dispatcher-utils.h"
#include "nm-dispatcher-api.h"
......
......@@ -21,7 +21,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -30,6 +29,7 @@
#include <readline/readline.h>
#include <readline/history.h>
#include "nm-glib.h"
#include "common.h"
#include "utils.h"
#include "nm-secret-agent-simple.h"
......
......@@ -21,7 +21,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -30,8 +29,7 @@
#include <readline/readline.h>
#include <readline/history.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "common.h"
#include "utils.h"
......
......@@ -19,7 +19,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <string.h>
......@@ -31,6 +30,7 @@
#include <readline/readline.h>
#include <readline/history.h>
#include "nm-glib.h"
#include "gsystem-local-alloc.h"
#include "utils.h"
#include "common.h"
......
......@@ -25,9 +25,9 @@
#include <errno.h>
#include <readline/readline.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "nm-secret-agent-simple.h"
#include "polkit-agent.h"
#include "utils.h"
......
......@@ -22,14 +22,13 @@
#include <string.h>
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "polkit-agent.h"
#include "utils.h"
#include "general.h"
/* Available fields for 'general status' */
static NmcOutputField nmc_fields_nm_status[] = {
{"RUNNING", N_("RUNNING"), 15}, /* 0 */
......
......@@ -33,12 +33,11 @@
#include <readline/readline.h>
#include <readline/history.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "polkit-agent.h"
#include "nmcli.h"
#include "nm-glib-compat.h"
#include "utils.h"
#include "common.h"
#include "connections.h"
......
......@@ -27,9 +27,9 @@
#include <unistd.h>
#include <termios.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "polkit-agent.h"
#include "nm-polkit-listener.h"
#include "common.h"
......@@ -142,7 +142,7 @@ nmc_start_polkit_agent_start_try (NmCli *nmc)
#else
/* polkit agent is not avalable; implement stub functions. */
#include <glib.h>
#include "nm-glib.h"
#include "nmcli.h"
#include "polkit-agent.h"
......
......@@ -22,13 +22,12 @@
#include <stdlib.h>
#include <arpa/inet.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "utils.h"
#include "common.h"
#include "settings.h"
#include "nm-glib-compat.h"
#include "nm-macros-internal.h"
#include "gsystem-local-alloc.h"
......
......@@ -29,9 +29,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "utils.h"
int
......
......@@ -36,10 +36,9 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "nm-polkit-listener.h"
G_DEFINE_TYPE (NMPolkitListener, nm_polkit_listener, POLKIT_AGENT_TYPE_LISTENER)
......
......@@ -19,11 +19,11 @@
#ifndef __NM_POLKIT_LISTENER_H__
#define __NM_POLKIT_LISTENER_H__
#include <glib.h>
#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
#include <polkitagent/polkitagent.h>
#include "nm-glib.h"
G_BEGIN_DECLS
#define NM_TYPE_POLKIT_LISTENER (nm_polkit_listener_get_type ())
......
......@@ -41,7 +41,8 @@
#include <glib/gi18n.h>
#include <NetworkManager.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#define PROGRESS_STEPS 15
#define WAIT_STARTUP_TAG "wait-startup"
......
......@@ -19,9 +19,9 @@
#ifndef NMT_NEWT_TYPES_H
#define NMT_NEWT_TYPES_H
#include <glib-object.h>
#include <newt.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
G_BEGIN_DECLS
......
......@@ -30,7 +30,7 @@
#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "nmt-newt-utils.h"
static void
......
......@@ -20,7 +20,8 @@
#define NMT_NEWT_UTILS_H
#include <newt.h>
#include <glib.h>
#include "nm-glib.h"
G_BEGIN_DECLS
......
......@@ -33,7 +33,6 @@
#include <string.h>
#include "nm-editor-bindings.h"
#include "nm-gvaluearray-compat.h"
static void
value_transform_string_int (const GValue *src_value,
......
......@@ -27,10 +27,10 @@
#include "nmt-editor.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nmtui.h"
#include "nm-editor-utils.h"
......
......@@ -19,6 +19,7 @@
#ifndef NMT_MAC_ENTRY_H
#define NMT_MAC_ENTRY_H
#include "nm-glib.h"
#include "nm-utils.h"
#include "nmt-newt.h"
......
......@@ -27,9 +27,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-bond.h"
#include "nmt-address-list.h"
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-bridge-port.h"
G_DEFINE_TYPE (NmtPageBridgePort, nmt_page_bridge_port, NMT_TYPE_EDITOR_PAGE)
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-bridge.h"
#include "nmt-address-list.h"
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-dsl.h"
#include "nmt-page-ethernet.h"
#include "nmt-page-ppp.h"
......
......@@ -19,6 +19,7 @@
#ifndef NMT_PAGE_DSL_H
#define NMT_PAGE_DSL_H
#include "nm-glib.h"
#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ethernet.h"
#include "nmt-mac-entry.h"
#include "nmt-mtu-entry.h"
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-infiniband.h"
#include "nmt-mtu-entry.h"
......
......@@ -25,9 +25,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ip4.h"
#include "nmt-ip-entry.h"
#include "nmt-address-list.h"
......
......@@ -25,9 +25,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ip6.h"
#include "nmt-ip-entry.h"
#include "nmt-address-list.h"
......
......@@ -25,9 +25,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ppp.h"
#include "nmt-newt-section.h"
#include "nmt-newt-separator.h"
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-team-port.h"
G_DEFINE_TYPE (NmtPageTeamPort, nmt_page_team_port, NMT_TYPE_EDITOR_PAGE)
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-team.h"
#include "nmt-slave-list.h"
......
......@@ -19,6 +19,7 @@
#ifndef NMT_PAGE_TEAM_H
#define NMT_PAGE_TEAM_H
#include "nm-glib.h"
#include "nmt-editor-page-device.h"
G_BEGIN_DECLS
......
......@@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nm-editor-bindings.h"
#include "nmt-page-vlan.h"
......
......@@ -29,9 +29,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-wifi.h"
#include "nmt-mac-entry.h"
#include "nmt-mtu-entry.h"
......
......@@ -27,9 +27,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-route-editor.h"
#include "nmt-route-table.h"
......
......@@ -19,7 +19,7 @@
#ifndef NMT_UTILS_H
#define NMT_UTILS_H
#include <glib-object.h>
#include "nm-glib.h"
G_BEGIN_DECLS
......
......@@ -30,11 +30,11 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <NetworkManager.h>
#include "nm-glib.h"
#include "nmt-newt.h"
#include "nm-editor-bindings.h"
......
......@@ -31,7 +31,6 @@
#include "config.h"
#include <string.h>
#include <glib.h>
#include <gmodule.h>
#include <glib/gi18n.h>
......@@ -39,6 +38,7 @@
#include <nm-setting-connection.h>
#include <nm-setting-vpn.h>
#include "nm-glib.h"
#include "vpn-helpers.h"
#define NM_VPN_API_SUBJECT_TO_CHANGE
......
......@@ -19,12 +19,13 @@
#ifndef _VPN_HELPERS_H_
#define _VPN_HELPERS_H_
#include <glib.h>
#include <nm-connection.h>
#define NM_VPN_API_SUBJECT_TO_CHANGE
#include <nm-vpn-plugin-ui-interface.h>
#include "nm-glib.h"
GHashTable *vpn_get_plugins (GError **error);
NMVpnPluginUiInterface *vpn_get_plugin_by_service (const char *service);
......
......@@ -297,7 +297,7 @@ PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
dnl GLIB_VERSION_MIN_REQUIRED should match the version above.
dnl GLIB_VERSION_MAX_ALLOWED should be set to the same version;
dnl nm-glib-compat.h will cause it to be overridden for the functions
dnl nm-glib.h will cause it to be overridden for the functions
dnl we have compat versions of.
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32"
......
......@@ -2,7 +2,7 @@ EXTRA_DIST = \
gsystem-local-alloc.h \
nm-dbus-compat.h \
nm-dbus-glib-types.h \
nm-glib-compat.h \
nm-glib.h \
nm-gvaluearray-compat.h \
nm-test-utils.h \
nm-macros-internal.h
......
......@@ -17,15 +17,13 @@
* Copyright 2008 - 2011 Red Hat, Inc.
*/
#ifndef __NM_GLIB_COMPAT_H__
#define __NM_GLIB_COMPAT_H__
#ifndef __NM_GLIB_H__
#define __NM_GLIB_H__
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <string.h>
#ifdef __clang__
#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
......@@ -43,7 +41,6 @@
#include "nm-gvaluearray-compat.h"
static inline void
__g_type_ensure (GType type)
{
......@@ -261,4 +258,4 @@ _g_key_file_save_to_file (GKeyFile *key_file,
#endif
#endif /* __NM_GLIB_COMPAT_H__ */
#endif /* __NM_GLIB_H__ */
......@@ -20,10 +20,6 @@
#ifndef __NM_GVALUEARRAY_COMPAT_H__
#define __NM_GVALUEARRAY_COMPAT_H__
#include <glib.h>
#include "nm-glib-compat.h"