ekiga r6207 - in trunk: . src/gui



Author: dsandras
Date: Thu Apr 17 22:19:51 2008
New Revision: 6207
URL: http://svn.gnome.org/viewvc/ekiga?rev=6207&view=rev

Log:
Fixed #527869.


Modified:
   trunk/ChangeLog
   trunk/src/gui/main.cpp

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Thu Apr 17 22:19:51 2008
@@ -179,8 +179,8 @@
   gint x;
   gint y;
   guint counter;
-  std::string last_status;
   gboolean idle;
+  gchar *last_status;
 };
 
 typedef struct _GmIdleTime GmIdleTime;
@@ -2365,8 +2365,7 @@
   GdkModifierType mask;
   gint x, y;
   gint timeout = 0;
-  gchar *st = NULL;
-  std::string status;
+  gchar *status = NULL;
                   
   idle = (GmIdleTime *) data;
 
@@ -2376,10 +2375,7 @@
 
   gdk_threads_enter ();
   timeout = gm_conf_get_int (PERSONAL_DATA_KEY "auto_away_timeout");
-  st = gm_conf_get_string (PERSONAL_DATA_KEY "short_status");
-  if (st != NULL)
-    status = st;
-  g_free (st);
+  status = gm_conf_get_string (PERSONAL_DATA_KEY "short_status");
   gdk_threads_leave ();
 
   if (x != idle->x && y != idle->y) {
@@ -2390,25 +2386,29 @@
 
     if (idle->idle == TRUE) {
       
-      //TODO Update status
+      gm_conf_set_string (PERSONAL_DATA_KEY "short_status", idle->last_status);
       idle->idle = FALSE;
+      g_free (idle->last_status);
     }
   }
   else
     idle->counter++;
 
-  if (status != "online")
+  if (status && strcmp ("online", status)) {
+    g_free (status);
     return TRUE;
+  }
   
   if ((idle->counter > (unsigned) (timeout * 12)) && !idle->idle) {
 
     idle->idle = TRUE;
 
     gdk_threads_enter ();
-    if (!status.empty ())
-      idle->last_status = status;
+    idle->last_status = g_strdup (status);
+    gm_conf_set_string (PERSONAL_DATA_KEY "short_status", "away");
     gdk_threads_leave ();
   }
+  g_free (status);
 
   return TRUE;
 }



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