summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-07-24 19:59:05 +0200
committerStefano Karapetsas <[email protected]>2013-07-24 19:59:05 +0200
commit3be92767b85acabf1f30e010cca425d322b89de2 (patch)
treea2b95e572dad332a349cc9b17c1c7f2dac33499c
parent147f55213c2592b118d16bb813041768769cf61b (diff)
downloadmate-power-manager-3be92767b85acabf1f30e010cca425d322b89de2.tar.bz2
mate-power-manager-3be92767b85acabf1f30e010cca425d322b89de2.tar.xz
Code improvements and deprecation fixesmate-power-manager-1.6.2
-rw-r--r--configure.ac2
-rw-r--r--src/gpm-backlight-helper.c2
-rw-r--r--src/gpm-button.c4
-rw-r--r--src/gpm-control.c7
-rw-r--r--src/gpm-main.c8
-rw-r--r--src/gpm-manager.c1
-rw-r--r--src/gpm-statistics.c5
7 files changed, 16 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index 0db0d32..89309ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,7 +139,7 @@ esac
dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gio-2.0 >= $GIO_REQUIRED)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gio-2.0 >= $GIO_REQUIRED gio-unix-2.0)
PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk >= $CANBERRA_REQUIRED)
diff --git a/src/gpm-backlight-helper.c b/src/gpm-backlight-helper.c
index a9c0fd4..3ad78c7 100644
--- a/src/gpm-backlight-helper.c
+++ b/src/gpm-backlight-helper.c
@@ -175,8 +175,10 @@ main (gint argc, gchar *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
+#if !GLIB_CHECK_VERSION(2,36,0)
/* setup type system */
g_type_init ();
+#endif
context = g_option_context_new (NULL);
/* TRANSLATORS: tool that is used when copying profiles system-wide */
diff --git a/src/gpm-button.c b/src/gpm-button.c
index 3c70ca1..1e38173 100644
--- a/src/gpm-button.c
+++ b/src/gpm-button.c
@@ -255,13 +255,13 @@ gpm_button_class_init (GpmButtonClass *klass)
gboolean
gpm_button_is_lid_closed (GpmButton *button)
{
- g_return_val_if_fail (GPM_IS_BUTTON (button), FALSE);
-
GDBusProxy *proxy;
GVariant *res, *inner;
gboolean lid;
GError *error = NULL;
+ g_return_val_if_fail (GPM_IS_BUTTON (button), FALSE);
+
if (LOGIND_RUNNING()) {
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
diff --git a/src/gpm-control.c b/src/gpm-control.c
index d7ba36c..cb84814 100644
--- a/src/gpm-control.c
+++ b/src/gpm-control.c
@@ -95,7 +95,7 @@ gpm_control_error_quark (void)
static gboolean
gpm_control_systemd_shutdown (void) {
GError *error = NULL;
- DBusGProxy *proxy;
+ GDBusProxy *proxy;
egg_debug ("Requesting systemd to shutdown");
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
@@ -217,8 +217,7 @@ gpm_control_suspend (GpmControl *control, GError **error)
#endif /* WITH_KEYRING */
GError *dbus_error = NULL;
- DBusGProxy *proxy;
- GVariant *res;
+ GDBusProxy *proxy;
screensaver = gpm_screensaver_new ();
@@ -329,7 +328,7 @@ gpm_control_hibernate (GpmControl *control, GError **error)
#endif /* WITH_KEYRING */
GError *dbus_error = NULL;
- DBusGProxy *proxy;
+ GDBusProxy *proxy;
screensaver = gpm_screensaver_new ();
diff --git a/src/gpm-main.c b/src/gpm-main.c
index 064ccf3..054cf3b 100644
--- a/src/gpm-main.c
+++ b/src/gpm-main.c
@@ -183,13 +183,14 @@ main (int argc, char *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
-#if GLIB_CHECK_VERSION(2,32,0)
-#else
+#if !GLIB_CHECK_VERSION(2,32,0)
if (! g_thread_supported ())
g_thread_init (NULL);
#endif
dbus_g_thread_init ();
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init ();
+#endif
context = g_option_context_new (N_("MATE Power Manager"));
/* TRANSLATORS: program name, a simple app to view pending updates */
@@ -203,8 +204,7 @@ main (int argc, char *argv[])
goto unref_program;
}
-#if GLIB_CHECK_VERSION(2,32,0)
-#else
+#if !GLIB_CHECK_VERSION(2,32,0)
if (!g_thread_supported ())
g_thread_init (NULL);
#endif
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index b1f760a..aeb5a31 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -35,6 +35,7 @@
#endif /* HAVE_UNISTD_H */
#include <glib/gi18n.h>
+#include <gio/gunixfdlist.h>
#include <gtk/gtk.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index 4813d1f..98b5632 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -1564,13 +1564,14 @@ main (int argc, char *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
-#if GLIB_CHECK_VERSION(2,32,0)
-#else
+#if !GLIB_CHECK_VERSION(2,32,0)
if (! g_thread_supported ())
g_thread_init (NULL);
#endif
dbus_g_thread_init ();
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init ();
+#endif
context = g_option_context_new (NULL);
/* TRANSLATORS: the program name */