gnome-power-manager r3121 - in trunk: . po src



Author: rhughes
Date: Tue Dec  2 18:15:36 2008
New Revision: 3121
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3121&view=rev

Log:
2008-12-02  Richard Hughes  <richard hughsie com>

* po/POTFILES.in:
* src/Makefile.am:
* src/gpm-cell-array.c: (gpm_cell_array_get_time_until_action),
(gpm_cell_array_percent_changed),
(gpm_cell_array_collection_changed),
(gpm_cell_array_get_description):
* src/gpm-self-test.c: (main):
Fix make distcheck. Nearly good to release.


Modified:
   trunk/ChangeLog
   trunk/po/POTFILES.in
   trunk/src/Makefile.am
   trunk/src/gpm-cell-array.c
   trunk/src/gpm-self-test.c

Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in	(original)
+++ trunk/po/POTFILES.in	Tue Dec  2 18:15:36 2008
@@ -42,10 +42,6 @@
 src/gpm-idle.h
 src/gpm-load.c
 src/gpm-load.h
-src/gpm-array.c
-src/gpm-array.h
-src/gpm-profile.c
-src/gpm-profile.h
 src/gpm-inhibit.c
 src/gpm-inhibit.h
 src/gpm-main.c

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Tue Dec  2 18:15:36 2008
@@ -217,8 +217,6 @@
 else
 	egg-color.c					\
 	egg-color.h					\
-	gpm-profile.h					\
-	gpm-profile.c					\
 	gpm-engine-old.h				\
 	gpm-engine-old.c				\
 	gpm-cell.h					\
@@ -292,41 +290,42 @@
 	gpm-engine.c					\
 	gpm-phone.h					\
 	gpm-phone.c					\
-	gpm-cell.h					\
-	gpm-cell.c					\
-	gpm-cell-unit.h					\
-	gpm-cell-unit.c					\
-	gpm-cell-array.h				\
-	gpm-cell-array.c				\
-	gpm-warnings.h					\
-	gpm-warnings.c					\
 	gpm-idle.h					\
 	gpm-idle.c					\
 	gpm-load.h					\
 	gpm-load.c					\
-	gpm-profile.h					\
-	gpm-profile.c					\
 	gpm-marshal.h					\
 	gpm-marshal.c					\
 	gpm-common.h					\
 	gpm-common.c					\
-	gpm-info.h					\
-	gpm-info.c					\
-	gpm-array.h					\
-	gpm-array.c					\
-	gpm-array-float.h				\
-	gpm-array-float.c				\
 	gpm-inhibit.h					\
 	gpm-inhibit.c					\
-	gpm-graph-widget-old.h				\
-	gpm-graph-widget-old.c				\
 	$(NULL)
 
+if HAVE_DK_POWER
+gnome_power_self_test_SOURCES +=			\
+	gpm-devicekit.h					\
+	gpm-devicekit.c					\
+	$(NULL)
+else
+gnome_power_self_test_SOURCES +=			\
+	gpm-warnings.h					\
+	gpm-warnings.c					\
+	gpm-cell.h					\
+	gpm-cell.c					\
+	gpm-cell-unit.h					\
+	gpm-cell-unit.c					\
+	gpm-cell-array.h				\
+	gpm-cell-array.c				\
+	$(NULL)
+endif
+
 gnome_power_self_test_LDADD =				\
 	$(GLIB_LIBS)					\
 	$(GNOME_LIBS)					\
 	$(GSTREAMER_LIBS)				\
 	$(POLKIT_GNOME_LIBS)				\
+	$(DEVKIT_POWER_LIBS)				\
 	$(DBUS_LIBS)					\
 	$(LIBNOTIFY_LIBS)				\
 	$(LOCAL_LIBHAL_LIBS)				\

Modified: trunk/src/gpm-cell-array.c
==============================================================================
--- trunk/src/gpm-cell-array.c	(original)
+++ trunk/src/gpm-cell-array.c	Tue Dec  2 18:15:36 2008
@@ -48,7 +48,6 @@
 static void     gpm_cell_array_finalize   (GObject	     *object);
 
 #define GPM_CELL_ARRAY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_CELL_ARRAY, GpmCellArrayPrivate))
-#define GPM_CELL_ARRAY_TEXT_MIN_ACCURACY	30
 #define GPM_CELL_ARRAY_TEXT_MIN_TIME		120
 #define GPM_UI_TIME_PRECISION			5*60
 
@@ -169,7 +168,6 @@
 {
 	GpmCellUnit *unit;
 	gboolean use_time_primary;
-	guint action_percentage;
 	guint action_time;
 	gint difference;
 
@@ -416,58 +414,6 @@
 }
 
 /**
- * gpm_cell_array_get_config_id:
- *
- * Gets an ID that represents the battery state of the system, typically
- * which will consist of all the serial numbers of primary batteries in the
- * system joined together.
- */
-static gchar *
-gpm_cell_array_get_config_id (GpmCellArray *cell_array)
-{
-	GpmCellUnit *unit;
-	GpmCell *cell;
-	gchar *id;
-	gchar *array_id = NULL;
-	gchar *new;
-	guint length;
-	guint i;
-
-	g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), NULL);
-
-	unit = &(cell_array->priv->unit);
-
-	/* invalid if not primary */
-	if (unit->kind != GPM_CELL_UNIT_KIND_PRIMARY) {
-		egg_warning ("only valid for primary");
-		return NULL;
-	}
-
-	length = cell_array->priv->array->len;
-	/* if we have no devices, don't try to get id */
-	if (length == 0) {
-		egg_debug ("no devices of type primary");
-		return NULL;
-	}
-
-	/* iterate thru all the devices */
-	for (i=0;i<length;i++) {
-		/* get the correct cell */
-		cell = gpm_cell_array_get_cell (cell_array, i);
-		id = gpm_cell_get_id (cell);
-		if (array_id == NULL) {
-			array_id = id;
-		} else {
-			new = g_strjoin ("-", array_id, id, NULL);
-			g_free (array_id);
-			g_free (id);
-			array_id = new;
-		}
-	}
-	return array_id;
-}
-
-/**
  * gpm_cell_array_emit_system_action:
  *
  * Do the emits here. Probably.
@@ -508,7 +454,6 @@
 {
 	GpmWarningsState warnings_state;
 	GpmCellUnit *unit;
-	gfloat accuracy;
 
 	g_return_if_fail (GPM_IS_CELL_ARRAY (cell_array));
 
@@ -722,7 +667,6 @@
 gpm_cell_array_collection_changed (GpmCellArray *cell_array)
 {
 	GpmCellUnit *unit;
-	gchar *config_id;
 	guint length;
 
 	g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), FALSE);
@@ -917,8 +861,6 @@
 	gchar *charge_timestring;
 	gchar *discharge_timestring;
 	gchar *description = NULL;
-	guint accuracy;
-	guint time;
 	guint charge_time_round;
 	guint discharge_time_round;
 	GpmCellUnit *unit;
@@ -981,8 +923,7 @@
 	} else if (unit->is_charging) {
 
 		if (charge_time_round > GPM_CELL_ARRAY_TEXT_MIN_TIME &&
-		    discharge_time_round > GPM_CELL_ARRAY_TEXT_MIN_TIME &&
-		    accuracy > GPM_CELL_ARRAY_TEXT_MIN_ACCURACY) {
+		    discharge_time_round > GPM_CELL_ARRAY_TEXT_MIN_TIME) {
 			/* display both discharge and charge time */
 			charge_timestring = gpm_get_timestring (charge_time_round);
 			discharge_timestring = gpm_get_timestring (discharge_time_round);

Modified: trunk/src/gpm-self-test.c
==============================================================================
--- trunk/src/gpm-self-test.c	(original)
+++ trunk/src/gpm-self-test.c	Tue Dec  2 18:15:36 2008
@@ -64,9 +64,11 @@
 	egg_color_test (test);
 
 	gpm_common_test (test);
+#ifndef HAVE_DK_POWER
 	gpm_cell_unit_test (test);
 	gpm_cell_test (test);
 	gpm_cell_test_array (test);
+#endif
 	gpm_inhibit_test (test);
 	gpm_phone_test (test);
 //	gpm_graph_widget_test (test);



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