[gnome-power-manager] Remove the use of HAL from gnome-power-manager.
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager] Remove the use of HAL from gnome-power-manager.
- Date: Thu, 29 Apr 2010 14:16:21 +0000 (UTC)
commit 02f23be68cac1e5a01dddde152b6dd8de8c3e71a
Author: Richard Hughes <richard hughsie com>
Date: Thu Apr 29 14:47:26 2010 +0100
Remove the use of HAL from gnome-power-manager.
Using HAL as a fallback has gone on long enough.
People just need to be using a sane x drivers now
Makefile.am | 13 +-
configure.ac | 12 -
libhal-glib/.gitignore | 9 -
libhal-glib/Makefile.am | 52 ----
libhal-glib/egg-dbus-monitor.c | 1 -
libhal-glib/egg-dbus-monitor.h | 1 -
libhal-glib/egg-dbus-proxy.c | 1 -
libhal-glib/egg-dbus-proxy.h | 1 -
libhal-glib/egg-debug.c | 1 -
libhal-glib/egg-debug.h | 1 -
libhal-glib/hal-device.c | 260 --------------------
libhal-glib/hal-device.h | 71 ------
libhal-glib/hal-manager.c | 357 ---------------------------
libhal-glib/hal-manager.h | 86 -------
libhal-glib/hal-marshal.list | 9 -
po/POTFILES.in | 1 -
src/Makefile.am | 24 --
src/gpm-brightness-hal.c | 530 ----------------------------------------
src/gpm-brightness-hal.h | 67 -----
src/gpm-brightness.c | 76 ------
20 files changed, 1 insertions(+), 1572 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index f7d32bd..36f06a1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,14 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS =
-
-# we have to do this first
-if HAVE_HAL
-SUBDIRS += libhal-glib
-endif
-
-SUBDIRS += \
+SUBDIRS = \
src \
po \
docs \
@@ -21,10 +14,6 @@ if HAVE_APPLETS
SUBDIRS += applets
endif
-if HAVE_HAL
-SUBDIRS += libhal-glib
-endif
-
EXTRA_DIST = \
HACKING \
MAINTAINERS \
diff --git a/configure.ac b/configure.ac
index 7fa5907..65a1f2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,16 +196,6 @@ AC_ARG_WITH(doc-dir,
AC_SUBST(DOCDIR)
dnl ---------------------------------------------------------------------------
-dnl - HAL support
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(hal, AS_HELP_STRING([--enable-hal],[Build using HAL support]),
- enable_hal=$enableval,enable_hal=no)
-if test x$enable_hal = xyes; then
- AC_DEFINE(HAVE_HAL, 1, [Define if we have HAL support])
-fi
-AM_CONDITIONAL([HAVE_HAL], [test $enable_hal = yes])
-
-dnl ---------------------------------------------------------------------------
dnl - Build self tests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(tests,
@@ -320,7 +310,6 @@ src/Makefile
applets/Makefile
applets/brightness/Makefile
applets/inhibit/Makefile
-libhal-glib/Makefile
docs/Makefile
man/Makefile
help/Makefile
@@ -369,7 +358,6 @@ echo "
compiler: ${CC}
cflags: ${CFLAGS}
Building extra applets: ${enable_applets}
- HAL (brightness) support: ${enable_hal}
Self test support: ${have_tests}
GConf default support: ${have_gconfdefaults}
Docbook support: ${enable_docbook_docs}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 46175fd..49150fc 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -13,7 +13,6 @@ data/gnome-power-statistics.desktop.in.in
[type: gettext/glade]data/gpm-statistics.ui
[type: gettext/glade]data/gpm-prefs.ui
src/gpm-backlight.c
-src/gpm-brightness-hal.c
src/gpm-brightness-xrandr.c
src/gpm-button.c
src/gpm-control.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 1aae62e..2dc76f5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -38,11 +38,6 @@ INCLUDES = \
-I$(top_srcdir)/libhal-glib \
$(NULL)
-if HAVE_HAL
-LOCAL_LIBHAL_LIBS = \
- $(top_builddir)/libhal-glib/libhal.la
-endif
-
bin_PROGRAMS = \
gnome-power-manager \
gnome-power-preferences \
@@ -121,10 +116,6 @@ gnome_power_preferences_LDADD = \
$(UPOWER_LIBS) \
-lm
-if HAVE_HAL
-gnome_power_preferences_LDADD += $(LOCAL_LIBHAL_LIBS)
-endif
-
gnome_power_preferences_CFLAGS = \
$(WARNINGFLAGS) \
$(NULL)
@@ -170,13 +161,6 @@ gnome_power_manager_SOURCES = \
gpm-engine.c \
$(NULL)
-if HAVE_HAL
-gnome_power_manager_SOURCES += \
- gpm-brightness-hal.h \
- gpm-brightness-hal.c \
- $(NULL)
-endif
-
gnome_power_manager_LDADD = \
libgpmshared.a \
$(GLIB_LIBS) \
@@ -191,10 +175,6 @@ gnome_power_manager_LDADD = \
$(UPOWER_LIBS) \
-lm
-if HAVE_HAL
-gnome_power_manager_LDADD += $(LOCAL_LIBHAL_LIBS)
-endif
-
gnome_power_manager_CFLAGS = \
$(WARNINGFLAGS) \
$(NULL)
@@ -263,10 +243,6 @@ gnome_power_self_test_LDADD = \
$(GPM_EXTRA_LIBS) \
-lm
-if HAVE_HAL
-gnome_power_self_test_LDADD += $(LOCAL_LIBHAL_LIBS)
-endif
-
gnome_power_self_test_CFLAGS = -DEGG_TEST $(AM_CFLAGS) $(WARNINGFLAGS)
BUILT_SOURCES = \
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index 8e18250..d1804a7 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -36,9 +36,6 @@
#endif /* HAVE_UNISTD_H */
#include "gpm-brightness.h"
-#ifdef HAVE_HAL
-#include "gpm-brightness-hal.h"
-#endif
#include "gpm-brightness-xrandr.h"
#include "gpm-common.h"
#include "egg-debug.h"
@@ -50,15 +47,9 @@
struct GpmBrightnessPrivate
{
gboolean use_xrandr;
-#ifdef HAVE_HAL
- gboolean use_hal;
-#endif
gboolean has_changed_events;
gboolean cache_trusted;
guint cache_percentage;
-#ifdef HAVE_HAL
- GpmBrightnessHal *hal;
-#endif
GpmBrightnessXRandR *xrandr;
};
@@ -141,14 +132,6 @@ gpm_brightness_set (GpmBrightness *brightness, guint percentage, gboolean *hw_ch
egg_warning ("failed to set using xrandr, falling back to HAL");
brightness->priv->use_xrandr = FALSE;
}
-#ifdef HAVE_HAL
- if (brightness->priv->use_hal) {
- ret = gpm_brightness_hal_set (brightness->priv->hal, percentage, &hw_changed_local);
- if (ret)
- goto out;
- egg_warning ("failed to set using HAL");
- }
-#endif
egg_debug ("no hardware support");
return FALSE;
out:
@@ -196,14 +179,6 @@ gpm_brightness_get (GpmBrightness *brightness, guint *percentage)
egg_warning ("failed to set using xrandr, falling back to HAL");
brightness->priv->use_xrandr = FALSE;
}
-#ifdef HAVE_HAL
- if (brightness->priv->use_hal) {
- ret = gpm_brightness_hal_get (brightness->priv->hal, &percentage_local);
- if (ret)
- goto out;
- egg_warning ("failed to set using HAL");
- }
-#endif
egg_debug ("no hardware support");
return FALSE;
out:
@@ -246,14 +221,6 @@ gpm_brightness_up (GpmBrightness *brightness, gboolean *hw_changed)
egg_warning ("failed to set using xrandr, falling back to HAL");
brightness->priv->use_xrandr = FALSE;
}
-#ifdef HAVE_HAL
- if (brightness->priv->use_hal) {
- ret = gpm_brightness_hal_up (brightness->priv->hal, &hw_changed_local);
- if (ret)
- goto out;
- egg_warning ("failed to set using HAL");
- }
-#endif
egg_debug ("no hardware support");
return FALSE;
out:
@@ -290,14 +257,6 @@ gpm_brightness_down (GpmBrightness *brightness, gboolean *hw_changed)
egg_warning ("failed to set using xrandr, falling back to HAL");
brightness->priv->use_xrandr = FALSE;
}
-#ifdef HAVE_HAL
- if (brightness->priv->use_hal) {
- ret = gpm_brightness_hal_down (brightness->priv->hal, &hw_changed_local);
- if (ret)
- goto out;
- egg_warning ("failed to set using HAL");
- }
-#endif
egg_debug ("no hardware support");
return FALSE;
out:
@@ -318,11 +277,7 @@ gboolean
gpm_brightness_has_hw (GpmBrightness *brightness)
{
g_return_val_if_fail (GPM_IS_BRIGHTNESS (brightness), FALSE);
-#ifdef HAVE_HAL
- return (brightness->priv->use_xrandr || brightness->priv->use_hal);
-#else
return brightness->priv->use_xrandr;
-#endif
}
/**
@@ -335,9 +290,6 @@ gpm_brightness_finalize (GObject *object)
g_return_if_fail (object != NULL);
g_return_if_fail (GPM_IS_BRIGHTNESS (object));
brightness = GPM_BRIGHTNESS (object);
-#ifdef HAVE_HAL
- g_object_unref (brightness->priv->hal);
-#endif
g_object_unref (brightness->priv->xrandr);
G_OBJECT_CLASS (gpm_brightness_parent_class)->finalize (object);
}
@@ -400,20 +352,6 @@ gpm_brightness_xrandr_changed_cb (GpmBrightnessXRandR *xrandr, guint percentage,
gpm_brightness_changed (brightness, percentage);
}
-#ifdef HAVE_HAL
-/**
- * gpm_brightness_hal_changed_cb:
- * This callback is called when the brightness value changes.
- **/
-static void
-gpm_brightness_hal_changed_cb (GpmBrightnessHal *hal, guint percentage, GpmBrightness *brightness)
-{
- g_return_if_fail (GPM_IS_BRIGHTNESS (brightness));
- if (brightness->priv->use_hal)
- gpm_brightness_changed (brightness, percentage);
-}
-#endif
-
/**
* gpm_brightness_init:
* @brightness: This brightness class instance
@@ -424,9 +362,6 @@ gpm_brightness_init (GpmBrightness *brightness)
brightness->priv = GPM_BRIGHTNESS_GET_PRIVATE (brightness);
brightness->priv->use_xrandr = FALSE;
-#ifdef HAVE_HAL
- brightness->priv->use_hal = FALSE;
-#endif
brightness->priv->cache_trusted = FALSE;
brightness->priv->has_changed_events = FALSE;
brightness->priv->cache_percentage = 0;
@@ -438,17 +373,6 @@ gpm_brightness_init (GpmBrightness *brightness)
}
g_signal_connect (brightness->priv->xrandr, "brightness-changed",
G_CALLBACK (gpm_brightness_xrandr_changed_cb), brightness);
-#ifdef HAVE_HAL
- if (!brightness->priv->use_xrandr) {
- brightness->priv->hal = gpm_brightness_hal_new ();
- if (gpm_brightness_hal_has_hw (brightness->priv->hal)) {
- egg_debug ("detected HAL hardware");
- brightness->priv->use_hal = TRUE;
- }
- g_signal_connect (brightness->priv->hal, "brightness-changed",
- G_CALLBACK (gpm_brightness_hal_changed_cb), brightness);
- }
-#endif
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]