summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2008-11-11 10:44:08 -0500
committerDavid Zeuthen <davidz@redhat.com>2008-11-11 10:44:08 -0500
commitfca50189968bd0abc2973b34867cee22268d8919 (patch)
tree760d45f03cb65f353490306c89b6f7e833005348 /tools
parent9f4bdecd33119b53b52a29c9dafb43d119f864c1 (diff)
downloadupower-fca50189968bd0abc2973b34867cee22268d8919.tar.gz
nuke devkit-power-on-battery for now
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am18
-rw-r--r--tools/dkp-battery-power.c69
2 files changed, 1 insertions, 86 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index c796d1d..c4309a0 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -34,7 +34,7 @@ dkp-marshal.c: $(top_srcdir)/src/dkp-marshal.list
dkp-daemon-glue.h: $(top_srcdir)/src/org.freedesktop.DeviceKit.Power.xml Makefile.am
dbus-binding-tool --prefix=devkit_power_daemon --mode=glib-client --output=dkp-daemon-glue.h $(top_srcdir)/src/org.freedesktop.DeviceKit.Power.xml
-bin_PROGRAMS = devkit-power devkit-power-on-battery
+bin_PROGRAMS = devkit-power
devkit_power_SOURCES = \
egg-debug.c \
@@ -52,22 +52,6 @@ devkit_power_LDADD = \
$(DEVKIT_POWER_LIBS) \
$(POLKIT_DBUS_LIBS)
-devkit_power_on_battery_SOURCES = \
- egg-debug.c \
- egg-debug.h \
- dkp-battery-power.c \
- $(BUILT_SOURCES)
-
-devkit_power_on_battery_CPPFLAGS = \
- -DG_LOG_DOMAIN=\"devkit-power\" \
- $(DISABLE_DEPRECATED) \
- $(AM_CPPFLAGS)
-
-devkit_power_on_battery_LDADD = \
- $(DBUS_GLIB_LIBS) \
- $(DEVKIT_POWER_LIBS) \
- $(POLKIT_DBUS_LIBS)
-
CLEANFILES = $(BUILT_SOURCES)
clean-local :
diff --git a/tools/dkp-battery-power.c b/tools/dkp-battery-power.c
deleted file mode 100644
index f32adc5..0000000
--- a/tools/dkp-battery-power.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#include <glib.h>
-#include <dbus/dbus-glib.h>
-#include "egg-debug.h"
-
-/**
- * main:
- **/
-int
-main (int argc, char **argv)
-{
- gint retval = 1;
- gboolean ret;
- gboolean on_battery;
- GError *error = NULL;
- DBusGConnection *bus = NULL;
- DBusGProxy *proxy = NULL;
- gboolean verbose = FALSE;
- GOptionContext *context;
-
- const GOptionEntry entries[] = {
- { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Show extra debugging information", NULL },
- { NULL }
- };
-
- g_type_init ();
-
- context = g_option_context_new ("devkit-battery-power");
- g_option_context_add_main_entries (context, entries, NULL);
- g_option_context_parse (context, &argc, &argv, NULL);
- g_option_context_free (context);
- egg_debug_init (verbose);
-
- bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
- if (bus == NULL) {
- egg_warning ("Couldn't connect to system bus: %s", error->message);
- g_error_free (error);
- goto out;
- }
-
- proxy = dbus_g_proxy_new_for_name (bus,
- "org.freedesktop.DeviceKit.Power",
- "/org/freedesktop/DeviceKit/Power",
- "org.freedesktop.DeviceKit.Power");
- if (proxy == NULL) {
- egg_warning ("Couldn't connect to DeviceKit-power");
- goto out;
- }
-
- ret = dbus_g_proxy_call (proxy, "GetOnBattery", &error,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &on_battery,
- G_TYPE_INVALID);
- if (!ret) {
- egg_debug ("GetOnBattery failed: %s", error->message);
- g_error_free (error);
- goto out;
- }
-
- g_print ("on-battery: %s\n", on_battery ? "yes" : "no");
- retval = 0;
-
-out:
- if (proxy != NULL)
- g_object_unref (proxy);
- if (bus != NULL)
- dbus_g_connection_unref (bus);
- return retval;
-}
-