[ekiga] RosterViewGtk: Fixed transition changes.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] RosterViewGtk: Fixed transition changes.
- Date: Sun, 11 Jan 2015 14:15:26 +0000 (UTC)
commit f49cffba7c16bf949cb7616374f5559641fdc29a
Author: Damien Sandras <dsandras seconix com>
Date: Sun Jan 11 15:13:58 2015 +0100
RosterViewGtk: Fixed transition changes.
lib/engine/gui/gtk-frontend/roster-view-gtk.cpp | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
index 341acc5..e3caa43 100644
--- a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
@@ -1176,17 +1176,23 @@ on_presentity_added (RosterViewGtk* self,
COLUMN_TIMEOUT, &timeout,
COLUMN_PRESENCE, &old_presence, -1);
+ // We already know the presence status
+ if (old_presence && presence == old_presence) {
+ g_free (old_presence);
+ return;
+ }
+
+ if (timeout > 0)
+ g_source_remove (timeout);
+ timeout = 0;
+
// If presence was already set, and we are moving
// from "offline" or "unknown" to something else,
// trigger an animation
if (old_presence
- && presence != old_presence
&& presence != "unknown" && presence != "offline"
&& (!g_strcmp0 (old_presence, "unknown") || !g_strcmp0 (old_presence, "offline"))) {
- if (timeout > 0)
- g_source_remove (timeout);
-
StatusIconInfo *info = new StatusIconInfo ();
info->model = GTK_TREE_MODEL (self->priv->store);
info->iter = gtk_tree_iter_copy (&iter);
@@ -1195,8 +1201,8 @@ on_presentity_added (RosterViewGtk* self,
timeout = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 1, roster_view_gtk_icon_blink_cb,
(gpointer) info, (GDestroyNotify) status_icon_info_delete);
}
+ else {
- if (timeout == 0) {
std::string icon = "user-offline";
if (presence != "unknown")
icon = "user-" + std::string(presence);
@@ -1221,7 +1227,7 @@ on_presentity_added (RosterViewGtk* self,
COLUMN_HEAP, heap.get (),
COLUMN_PRESENTITY, presentity.get (),
COLUMN_NAME, presentity->get_name ().c_str (),
- COLUMN_STATUS, presentity->get_status ().c_str (),
+ COLUMN_STATUS, (presence == "unknown" || presence == "offline")?
"":presentity->get_status ().c_str (),
COLUMN_PRESENCE, presentity->get_presence ().c_str (),
COLUMN_AVATAR_PIXBUF, pixbuf,
COLUMN_TIMEOUT, timeout,
@@ -1506,6 +1512,8 @@ roster_view_gtk_update_groups (RosterViewGtk *view,
gtk_tree_model_get (GTK_TREE_MODEL (view->priv->store), &iter,
COLUMN_TIMEOUT, &timeout,
-1);
+ if (timeout > 0)
+ g_source_remove (timeout);
go_on = gtk_tree_store_remove (view->priv->store, &iter);
}
} while (go_on);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]