Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
NetworkManager
NetworkManager
Commits
279a347a
Commit
279a347a
authored
Feb 24, 2013
by
Dan Winship
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: remove GLIB_CHECK_VERSION checks from GDBus examples
parent
38035856
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
12 deletions
+0
-12
examples/C/glib/monitor-nm-running-GDBus.c
examples/C/glib/monitor-nm-running-GDBus.c
+0
-6
examples/C/glib/monitor-nm-state-GDBus.c
examples/C/glib/monitor-nm-state-GDBus.c
+0
-6
No files found.
examples/C/glib/monitor-nm-running-GDBus.c
View file @
279a347a
...
@@ -31,7 +31,6 @@
...
@@ -31,7 +31,6 @@
#include <gio/gio.h>
#include <gio/gio.h>
#if GLIB_CHECK_VERSION(2,26,0)
static
void
static
void
on_name_appeared
(
GDBusConnection
*
connection
,
on_name_appeared
(
GDBusConnection
*
connection
,
const
gchar
*
name
,
const
gchar
*
name
,
...
@@ -49,13 +48,11 @@ on_name_vanished (GDBusConnection *connection,
...
@@ -49,13 +48,11 @@ on_name_vanished (GDBusConnection *connection,
{
{
g_print
(
"Name '%s' does not exist on the system bus => NM is not running
\n
"
,
name
);
g_print
(
"Name '%s' does not exist on the system bus => NM is not running
\n
"
,
name
);
}
}
#endif
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
#if GLIB_CHECK_VERSION(2,26,0)
guint
watcher_id
;
guint
watcher_id
;
GMainLoop
*
loop
;
GMainLoop
*
loop
;
GBusNameWatcherFlags
flags
;
GBusNameWatcherFlags
flags
;
...
@@ -83,9 +80,6 @@ main (int argc, char *argv[])
...
@@ -83,9 +80,6 @@ main (int argc, char *argv[])
/* Stop watching the name */
/* Stop watching the name */
g_bus_unwatch_name
(
watcher_id
);
g_bus_unwatch_name
(
watcher_id
);
#else
g_print
(
"Sorry, you need at least GLib 2.26 for GDBus.
\n
"
);
#endif
return
0
;
return
0
;
}
}
...
...
examples/C/glib/monitor-nm-state-GDBus.c
View file @
279a347a
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
#include <string.h>
#include <string.h>
#include <NetworkManager.h>
#include <NetworkManager.h>
#if GLIB_CHECK_VERSION(2,26,0)
static
const
char
*
static
const
char
*
nm_state_to_string
(
NMState
state
)
nm_state_to_string
(
NMState
state
)
{
{
...
@@ -82,13 +81,11 @@ on_signal (GDBusProxy *proxy,
...
@@ -82,13 +81,11 @@ on_signal (GDBusProxy *proxy,
g_print
(
"NetworkManager state is: (%d) %s
\n
"
,
new_state
,
nm_state_to_string
((
NMState
)
new_state
));
g_print
(
"NetworkManager state is: (%d) %s
\n
"
,
new_state
,
nm_state_to_string
((
NMState
)
new_state
));
}
}
}
}
#endif
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
#if GLIB_CHECK_VERSION(2,26,0)
GMainLoop
*
loop
;
GMainLoop
*
loop
;
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
GDBusProxyFlags
flags
;
GDBusProxyFlags
flags
;
...
@@ -129,9 +126,6 @@ main (int argc, char *argv[])
...
@@ -129,9 +126,6 @@ main (int argc, char *argv[])
g_main_loop_run
(
loop
);
g_main_loop_run
(
loop
);
g_object_unref
(
proxy
);
g_object_unref
(
proxy
);
#else
g_print
(
"Sorry, you need at least GLib 2.26 for GDBus.
\n
"
);
#endif
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment