gnome-power-manager r3134 - in trunk: . src



Author: rhughes
Date: Fri Dec 19 09:45:27 2008
New Revision: 3134
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3134&view=rev

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

* src/gpm-feedback-widget.c:
* src/gpm-refcount.c: (gpm_refcount_add),
(gpm_refcount_set_timeout):
Convert the one last g_timeout_add into g_timeout_add_seconds.
Fixes #565076


Modified:
   trunk/ChangeLog
   trunk/src/gpm-feedback-widget.c
   trunk/src/gpm-refcount.c

Modified: trunk/src/gpm-feedback-widget.c
==============================================================================
--- trunk/src/gpm-feedback-widget.c	(original)
+++ trunk/src/gpm-feedback-widget.c	Fri Dec 19 09:45:27 2008
@@ -39,7 +39,7 @@
 
 #define GPM_FEEDBACK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_FEEDBACK, GpmFeedbackPrivate))
 
-#define GPM_FEEDBACK_TIMOUT		2000	/* ms */
+#define GPM_FEEDBACK_TIMOUT		2	/* s */
 
 struct GpmFeedbackPrivate
 {

Modified: trunk/src/gpm-refcount.c
==============================================================================
--- trunk/src/gpm-refcount.c	(original)
+++ trunk/src/gpm-refcount.c	Fri Dec 19 09:45:27 2008
@@ -38,7 +38,7 @@
 
 struct GpmRefcountPrivate
 {
-	guint		 timeout; /* ms */
+	guint		 timeout; /* s */
 	guint		 refcount;
 };
 
@@ -105,7 +105,7 @@
 	g_idle_remove_by_data (refcount);
 
 	/* add ONE automatic timeout */
-	g_timeout_add (refcount->priv->timeout, gpm_refcount_auto_decrement, refcount);
+	g_timeout_add_seconds (refcount->priv->timeout, gpm_refcount_auto_decrement, refcount);
 
 	return TRUE;
 }
@@ -135,6 +135,7 @@
 /**
  * gpm_refcount_set_timeout:
  * @refcount: This class instance
+ * @timeout: seconds
  * Return value: success
  **/
 gboolean
@@ -143,13 +144,13 @@
 	g_return_val_if_fail (refcount != NULL, FALSE);
 	g_return_val_if_fail (GPM_IS_REFCOUNT (refcount), FALSE);
 
-	if (timeout > 100000) {
+	if (timeout > 1000) {
 		egg_warning ("refcount is not designed for long timeouts");
 		return FALSE;
 	}
 	if (timeout == 0) {
 		egg_warning ("refcount cannot be zero");
-		timeout = 1000;
+		timeout = 1; /* seconds */
 	}
 
 	refcount->priv->timeout = timeout;



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