Commit graph

5 commits

Author SHA1 Message Date
Thomas Haller 0bdcab100c all: cleanup includes in header files
- don't include "nm-default.h" in header files. Every source file must
  include as first header "nm-default.h", thus our headers get the
  default include already implicitly.

- we don't support compiling NetworkManager itself with a C++ compiler. Remove
  G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support
  users of libnm to use C++, thus they stay in public headers.

(cherry picked from commit f19aff8909)
2016-08-17 19:51:17 +02:00
Thomas Haller 19c3ea948a all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
Dan Winship 3452ee2a0e 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).
2015-07-24 13:25:47 -04:00
Dan Winship acf86f68b3 libnm-core: change connection hash tables to variants in API
In preparation for porting to GDBus, make nm_connection_to_dbus(),
etc, represent connections as GVariants of type 'a{sa{sv}}' rather
than as GHashTables-of-GHashTables-of-GValues.

This means we're constantly converting back and forth internally, but
this is just a stepping stone on the way to the full GDBus port, and
all of that code will go away again later.
2014-09-18 11:51:09 -04:00
Dan Winship ca9938f458 libnm-core: drop NMParamSpecSpecialized, add nm_property_compare()
NMParamSpecSpecialized existed basically to provide a version of
GParamSpecBoxed that could compare dbus-glib-valued properties
correctly.

However, g_param_values_cmp() was only used by NM directly in one
place (NMSetting's compare_property()), and we don't actually need to
indirect through GParamSpec there; we could just call
NMParamSpecSpecialized's value-comparison function directly.

So, change all NMParamSpecSpecialized properties to GParamSpecBoxed,
rename the _gvalues_compare() function it used to
"nm_property_compare()", and use that from NMSetting.

(g_param_values_cmp() also gets used internally by
g_param_value_defaults(), but all NMParamSpecSpecialized properties
have a default value of NULL, so GParamSpecBoxed's pointer-equality
check will do the job just fine there.)
2014-09-04 09:20:10 -04:00