[gnome-applets] battstat: remove HAL support



commit 0afc37aa207cbc9abdf21880cd83cfbe18369582
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Aug 28 03:43:22 2014 +0300

    battstat: remove HAL support

 battstat/Makefile.am        |    4 -
 battstat/battstat-hal.c     |  608 -------------------------------------------
 battstat/battstat-hal.h     |   30 ---
 battstat/battstat.h         |    3 +-
 battstat/battstat_applet.c  |   13 +-
 battstat/power-management.c |   50 +----
 configure.ac                |   23 --
 po/POTFILES.in              |    1 -
 8 files changed, 6 insertions(+), 726 deletions(-)
---
diff --git a/battstat/Makefile.am b/battstat/Makefile.am
index 88a6cdf..0e72268 100644
--- a/battstat/Makefile.am
+++ b/battstat/Makefile.am
@@ -26,7 +26,6 @@ DIST_SUBDIRS = help sounds apmlib
 AM_CPPFLAGS =                                  \
        $(GNOME_APPLETS_CFLAGS)                 \
        $(LIBNOTIFY_CFLAGS)                     \
-       $(HAL_CFLAGS)                           \
        $(UPOWER_CFLAGS)                        \
        $(APMINC)                               \
        $(ACPIINC)                              \
@@ -48,8 +47,6 @@ battstat_applet_2_SOURCES = \
        acpi-linux.h \
        acpi-freebsd.c \
        acpi-freebsd.h \
-       battstat-hal.c \
-       battstat-hal.h \
        battstat-upower.c \
        battstat-upower.h
 
@@ -57,7 +54,6 @@ battstat_applet_2_SOURCES = \
 battstat_applet_2_LDADD = \
                     $(GNOME_APPLETS_LIBS) \
                     $(LIBNOTIFY_LIBS) \
-                    $(HAL_LIBS) \
                     $(UPOWER_LIBS) \
                     $(LIBM) \
                     $(APMLIB)
diff --git a/battstat/battstat.h b/battstat/battstat.h
index 6815f18..908d800 100644
--- a/battstat/battstat.h
+++ b/battstat/battstat.h
@@ -161,9 +161,8 @@ void battstat_show_help( ProgressData *battstat, const char *section );
 
 /* power-management.c */
 const char *power_management_getinfo( BatteryStatus *status );
-const char *power_management_initialise (int no_hal, void (*callback) (void));
+const char *power_management_initialise (void (*callback) (void));
 void power_management_cleanup( void );
-int power_management_using_hal( void );
 int power_management_using_upower( void );
 
 #endif /* _battstat_h_ */
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index be12560..6c1ee32 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -271,7 +271,7 @@ status_change_callback (void)
    it does.)
 */
 static const char *
-static_global_initialisation (int no_hal, ProgressData *battstat)
+static_global_initialisation (ProgressData *battstat)
 {
   gboolean first_time;
   const char *err;
@@ -284,7 +284,7 @@ static_global_initialisation (int no_hal, ProgressData *battstat)
     return NULL;
 
   initialise_global_pixmaps();
-  err = power_management_initialise (no_hal, status_change_callback);
+  err = power_management_initialise (status_change_callback);
 
   return err;
 }
@@ -1190,10 +1190,8 @@ about_cb( GtkAction *action, ProgressData *battstat )
                  _("This utility shows the status of your laptop battery."),
                  power_management_using_upower () ?
                        /* true */ _("upower backend enabled.") :
-                 (power_management_using_hal () ?
-                       /* true */ _("HAL backend enabled.") :
                        /* false */ _("Legacy (non-HAL) backend enabled.")
-                 ));
+                 );
 
   gtk_show_about_dialog( NULL,
     "version",             VERSION,
@@ -1565,7 +1563,6 @@ battstat_applet_fill (PanelApplet *applet)
   GtkActionGroup *action_group;
   gchar *ui_path;
   const char *err;
-  int no_hal;
 
   if (DEBUG) g_print("main()\n");
 
@@ -1626,9 +1623,7 @@ battstat_applet_fill (PanelApplet *applet)
          atk_object_set_description(atk_widget, _("Monitor a laptop's remaining power"));
   }
 
-  no_hal = panel_applet_gconf_get_bool( applet, "no_hal", NULL );
-
-  if ((err = static_global_initialisation (no_hal, battstat)))
+  if ((err = static_global_initialisation (battstat)))
     battstat_error_dialog (GTK_WIDGET (applet), err);
 
   return TRUE;
diff --git a/battstat/power-management.c b/battstat/power-management.c
index c2c477b..c368835 100644
--- a/battstat/power-management.c
+++ b/battstat/power-management.c
@@ -40,7 +40,6 @@
 #include <unistd.h>
 
 #include "battstat.h"
-#include "battstat-hal.h"
 #include "battstat-upower.h"
 
 #define ERR_ACPID _("Can't access ACPI events in /var/run/acpid.socket! "    \
@@ -64,9 +63,6 @@
 
 static const char *apm_readinfo (BatteryStatus *status);
 static int pm_initialised;
-#ifdef HAVE_HAL
-static int using_hal;
-#endif
 #ifdef HAVE_UPOWER
 static int using_upower;
 #endif
@@ -175,7 +171,6 @@ apm_readinfo (BatteryStatus *status)
 }
 
 #undef __linux__
-#undef HAVE_HAL
 
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 
@@ -402,14 +397,6 @@ power_management_getinfo( BatteryStatus *status )
   }
 #endif
 
-#ifdef HAVE_HAL
-  if( using_hal )
-  {
-    battstat_hal_get_battery_info( status );
-    return NULL;
-  }
-#endif
-
   retval = apm_readinfo( status );
 
   if(status->percent == -1) {
@@ -440,7 +427,7 @@ power_management_getinfo( BatteryStatus *status )
  * the problem might be.  This error message is not to be freed.
  */
 const char *
-power_management_initialise (int no_hal, void (*callback) (void))
+power_management_initialise (void (*callback) (void))
 {
   char *err;
   err = g_strdup( ":(" );
@@ -458,22 +445,6 @@ power_management_initialise (int no_hal, void (*callback) (void))
   } 
 #endif
 
-#ifdef HAVE_HAL
-  if(! no_hal ) {
-    err = battstat_hal_initialise (callback);
-
-    if( err == NULL ) /* HAL is up */
-    {
-      pm_initialised = 1;
-      using_hal = TRUE;
-      return NULL;
-    }
-  }
-
-  /* fallback to legacy methods */
-  g_free( err );
-#endif
-    
 #ifdef __linux__
 
   if (acpi_linux_init(&acpiinfo)) {
@@ -528,15 +499,6 @@ power_management_cleanup( void )
   }
 #endif
 
-#ifdef HAVE_HAL
-  if( using_hal )
-  {
-    battstat_hal_cleanup();
-    pm_initialised = 1;
-    return;
-  }
-#endif
-
 #ifdef __linux__
   if (using_acpi)
   {
@@ -563,13 +525,3 @@ power_management_using_upower( void )
   return 0;
 #endif
 }
-
-int
-power_management_using_hal( void )
-{
-#ifdef HAVE_HAL
-  return using_hal;
-#else
-  return 0;
-#endif
-}
diff --git a/configure.ac b/configure.ac
index a148bcb..ab49a7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,6 @@ LIBGTOP_REQUIRED=2.11.92
 LIBXKLAVIER_REQUIRED=4.0
 LIBWNCK_REQUIRED=2.91.0
 LIBNOTIFY_REQUIRED=0.7
-HAL_REQUIRED=0.5.3
 UPOWER_REQUIRED=0.9.4
 DBUS_REQUIRED=1.1.2
 DBUS_GLIB_REQUIRED=0.74
@@ -201,27 +200,6 @@ AM_CONDITIONAL(HAVE_POLKIT, test "x$HAVE_POLKIT" = "xyes")
 AC_SUBST(POLKIT_CFLAGS)
 AC_SUBST(POLKIT_LIBS)
 
-
-dnl -- check for libhal (optional) --------------------------------------------
-HAL_CFLAGS=
-HAL_LIBS=
-AC_ARG_WITH(hal,[  --without-hal           build without hal support])
-
-if test "x$with_hal" != xno; then
-       PKG_CHECK_MODULES(HAL, hal >= $HAL_REQUIRED dbus-glib-1 >= $DBUS_GLIB_REQUIRED,
-                 HAVE_HAL="yes",
-                 HAVE_HAL="no")
-
-       if test "x$HAVE_HAL" = "xyes"; then
-               AC_DEFINE(HAVE_HAL, 1, [HAL available])
-       fi
-else
-       AC_MSG_WARN(["Hal support disabled"])
-fi
-
-AC_SUBST(HAL_CFLAGS)
-AC_SUBST(HAL_LIBS)
-
 dnl -- check for libupower-glib (optional) --------------------------------------------
 UPOWER_CFLAGS=
 UPOWER_LIBS=
@@ -749,7 +727,6 @@ gnome-applets-$VERSION configure summary:
 
        Using DBUS:                     $HAVE_DBUS
        Using NetworkManager:           $HAVE_NETWORKMANAGER
-       Using HAL:                      $HAVE_HAL
        Using UPOWER:                   $HAVE_UPOWER
        Enabling IPv6:                  $have_ipv6
 " >&2
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 77fa6cc..97e29a6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,7 +6,6 @@ accessx-status/applet.c
 [type: gettext/ini]accessx-status/org.gnome.applets.AccessxStatusApplet.panel-applet.in.in
 battstat/battstat_applet.c
 [type: gettext/glade]battstat/battstat_applet.ui
-battstat/battstat-hal.c
 battstat/battstat.schemas.in
 [type: gettext/ini]battstat/org.gnome.applets.BattstatApplet.panel-applet.in.in
 battstat/properties.c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]