Commit Graph

39 Commits

Author SHA1 Message Date
Thomas Haller
f73e3669b3 examples: fix qt demo to work without STL support
The function toStdString() is only available when QT was
compiled with STL support. The configure script does
not check STL support and might build the QT examples
even if toStdString() is not available.

Fix this, by not using the function.

https://bugzilla.gnome.org/show_bug.cgi?id=727608

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-04 17:06:08 +02:00
Jiří Klimeš
7211d82f77 examples: use correct Mbit/s for bitrates 2014-04-01 15:15:18 +02:00
Thomas Haller
97935382f4 coverity: fix various warnings detected with Coverity
These are (most likely) only warnings and not severe bugs.
Some of these changes are mostly made to get a clean run of
Coverity without any warnings.

Error found by running Coverity scan

https://bugzilla.redhat.com/show_bug.cgi?id=1025894

Co-Authored-By: Jiří Klimeš <jklimes@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-13 15:29:24 +01:00
Thomas Haller
3eb1d5e902 core: cleanup freeing of glib collections of pointers
When freeing one of the collections such as GArray, GPtrArray, GSList,
etc. it is common that the items inside the connections must be
freed/unrefed too.

The previous code often iterated over the collection first with
e.g. g_ptr_array_foreach and passing e.g. g_free as GFunc argument.
For one, this has the problem, that g_free has a different signature
GDestroyNotify then the expected GFunc. Moreover, this can be
simplified either by setting a clear function
(g_ptr_array_set_clear_func) or by passing the destroy function to the
free function (g_slist_free_full).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-22 19:53:57 +02:00
Dan Winship
bfce3f7dc8 build: switch from $(INCLUDES) to $(AM_CPPFLAGS) to make automake happy
Unfortunately, $(AM_CPPFLAGS) gets overridden by per-target _CPPFLAGS
variables, which $(INCLUDES) did not, so this requires some additional
changes.

In most places, I have just gotten rid of the per-target _CPPFLAGS
variables; in directories with a single target, the per-target
variable is unnecessary, and in directories with multiple targets, the
per-target variable is often undesirable, since it forces some files
to be compiled twice, even though there ends up being no difference
between the two files.
2013-08-22 11:49:16 -04:00
Pavel Šimerda
5277719dce trivial: add gitignore for qt examples 2013-04-29 14:14:11 +02:00
Jiří Klimeš
82fb1978a4 all: use G_VALUE_INIT to initialize GValue variables
It makes the initializations more explicit.
G_VALUE_INIT is available since glib 2.30, and NM now require glib >= 2.32
2013-03-25 08:41:18 +01:00
Dan Winship
279a347abf examples: remove GLIB_CHECK_VERSION checks from GDBus examples 2013-02-26 13:07:32 +01:00
Jiří Klimeš
8a0e928aed cli/examples: NM_802_11_MODE_AP mode is not valid for NMAccessPoint objects 2012-11-01 15:40:27 +01:00
Colin Walters
1977fb6c49 build: clean up GLib-related pkg-config usage (bgo #687218)
We had separate checks for glib-2.0, gobject-2.0, gmodule-2.0, and
gio-unix-2.0.  It doesn't make sense to link a binary against all 4
because gio-unix-2.0 depends on glib-2.0 and gobject-2.0.  Doing this
actually breaks things in unusual circumstances.

Generally, few bits of NM actually just use glib, and not gio.  We
might as well coalesce those requirements together, even if it means
in some cases we "overlink".  Additionally, I chose for now to fold
gmodule-2.0 in as well, even though many fewer programs need it.  The
cost of overlinking is quite small.

The benefit of this is less repeated junk in Makefile.am, as well as
more centralized control over GLib.  A followup patch will allow us to
set -DGLIB_VERSION_MIN_REQUIRED in just one place, rather than having
to replicate it 4 times.

The NM configure is still suboptimal - for example, libpolkit-1
depends on gio-2.0, so really we should determine the compiler flags
all in one pass.  But it doesn't matter too much for now.
2012-10-31 21:08:18 +01:00
Jan Luebbe
f9c72dee3e wifi: support ap-mode with wpa_supplicant
A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the
new mode is passed to wpa_supplicant analogous to adhoc-mode.
The places which need to know the interface mode have been extended to
handle the new mode.

If the configuration does not contain a fixed frequency, a channel is
selected the same way as with adhoc-mode before.
2012-10-17 12:08:11 -05:00
Colin Walters
74ec56d956 build: fix srcdir != builddir for new generated headers 2012-02-22 16:27:28 -06:00
Jiří Klimeš
0b57cc68fd examples: fix dependency on GDBus (it's available only in GLib >= 2.26) 2012-02-14 09:03:21 +01:00
Jiří Klimeš
0c83e6e3b1 examples: add C example for monitoring overall NetworkManager state 2012-02-13 15:41:35 +01:00
Jiří Klimeš
38382770aa examples: add C examples for monitoring whether NM runs
- the first uses dbus-glib and D-Bus "NameOwnerChanged" signal directly
- the second uses GIO's g_bus_watch_name()
- the third uses Qt and QDBusServiceWatcher class
2012-02-03 11:55:46 +01:00
Colin Walters
dab7dfaf35 build: fix srcdir != builddir
nm-version.h is in ${top_builddir}/include.
2012-01-09 14:20:36 -06:00
Thomas Graf
5b7503e95e core: use nm_connection_get_setting_<type>() whenever possible
Leads to shorter, easier to read code and improves type casting safety.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:06:43 -06:00
Thomas Jarosch
1453abbebc test: add missing return values
Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
2011-10-10 16:02:27 -05:00
Jiří Klimeš
096a1fcdc9 examples: add a Qt example for setting manual IPv4 addresses into a connection 2011-06-08 19:18:53 +02:00
Eckhart Wörner
ff0ab192b9 examples: add another Qt example for listing connections 2011-04-20 19:49:41 -05:00
Eckhart Wörner
f8aa9f38da examples: add some Qt examples and build infrastructure 2011-04-20 19:48:32 -05:00
Dan Williams
d98f3f226a examples: move glib examples to a subdir 2011-04-20 19:25:50 -05:00
Dan Williams
3b0916d6f6 examples: rename another example 2011-04-20 19:15:33 -05:00
Dan Williams
4812fef794 examples: rename an example 2011-04-20 19:14:03 -05:00
Dan Williams
b599e3e5dc libnm-util: simplify nm_utils_ssid_to_utf8()
It's always used with a GByteArray anyway, as are most
functions in nm-utils.h.  Even better, we can skip the
memcpy since it turns out to be pointless.
2011-02-23 11:24:58 -06:00
Dan Williams
8b2a274660 examples: fix distcheck 2011-02-16 16:36:22 -06:00
Dan Williams
74f25416fe examples: add an example for adding a new connection with libnm-glib 2011-02-15 12:23:05 -06:00
Dan Williams
98d5da84aa examples: rename add-connection-glib 2011-02-15 12:09:25 -06:00
Dan Williams
ab3816ee21 examples: fix up add-connection-glib for recent API changes
AddConnection returns the object path of the new connection.
2011-02-15 12:06:13 -06:00
Dan Williams
e68e27aa75 libnm-util: add 'flags' argument to nm_connection_to_hash() and nm_setting_to_hash()
Simplifies code internally, and makes it easier for clients as well in
some cases where they want to control what ends up in the resulting
hash and what does not.
2011-01-26 14:14:37 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Jiří Klimeš
5705850779 examples: add C example showing APs' information 2010-12-17 13:42:07 +01:00
Jiří Klimeš
a6dccad94c examples: trivial comment fix 2010-12-13 17:13:16 +01:00
Jiří Klimeš
1beb2632a0 examples: fix double free() error in get-active-connections 2010-12-13 16:36:46 +01:00
Jiří Klimeš
ca6e6b620d examples: add C examples for listing connections from system settings service 2010-12-13 16:18:35 +01:00
Dan Williams
e821e61992 examples: update comments 2010-12-06 12:27:50 -06:00
Dan Williams
c602487ff3 test: add C example for printing active connection details 2010-12-06 12:14:06 -06:00
Dan Williams
fd3e8e4576 examples: build C examples 2010-12-06 12:12:52 -06:00
Jiří Klimeš
9ee41307fc examples: add example for adding a connection in C (using glib) 2010-09-30 21:09:01 +02:00