ekiga r6726 - trunk/lib/engine/gui/gtk-frontend
- From: jpuydt svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6726 - trunk/lib/engine/gui/gtk-frontend
- Date: Fri, 29 Aug 2008 15:44:21 +0000 (UTC)
Author: jpuydt
Date: Fri Aug 29 15:44:20 2008
New Revision: 6726
URL: http://svn.gnome.org/viewvc/ekiga?rev=6726&view=rev
Log:
Made the code for hide/show offline clearer
Modified:
trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
Modified: trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp (original)
+++ trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp Fri Aug 29 15:44:20 2008
@@ -185,6 +185,19 @@
GdkEventButton *event,
gpointer data);
+/* DESCRIPTION : Helpers for the next function
+ */
+
+static gboolean presentity_hide_show_offline (RosterViewGtk* self,
+ GtkTreeModel* model,
+ GtkTreeIter* iter);
+static gboolean group_hide_show_offline (RosterViewGtk* self,
+ GtkTreeModel* model,
+ GtkTreeIter* iter);
+static gboolean heap_hide_show_offline (RosterViewGtk* self,
+ GtkTreeModel* model,
+ GtkTreeIter* iter);
+
/* DESCRIPTION : Called to decide whether to show a line ; used to hide/show
* offline contacts on demand.
* BEHAVIOUR : Returns TRUE if the line should be shown.
@@ -698,13 +711,67 @@
}
static gboolean
+presentity_hide_show_offline (RosterViewGtk* self,
+ GtkTreeModel* model,
+ GtkTreeIter* iter)
+{
+ gboolean result = FALSE;
+
+ if (self->priv->show_offline_contacts)
+ result = TRUE;
+ else
+ gtk_tree_model_get (model, iter,
+ COLUMN_OFFLINE, &result,
+ -1);
+
+ return result;
+}
+
+static gboolean
+group_hide_show_offline (RosterViewGtk* self,
+ GtkTreeModel* model,
+ GtkTreeIter* iter)
+{
+ gboolean result;
+ GtkTreeIter child_iter;
+
+ if (self->priv->show_offline_contacts)
+ result = TRUE;
+ else {
+
+ if (gtk_tree_model_iter_nth_child (model, &child_iter, iter, 0)) {
+
+ do {
+
+ gtk_tree_model_get (model, &child_iter,
+ COLUMN_OFFLINE, &result,
+ -1);
+ } while (!result && gtk_tree_model_iter_next (model, &child_iter));
+ }
+ }
+
+ return result;
+}
+
+static gboolean
+heap_hide_show_offline (G_GNUC_UNUSED RosterViewGtk* self,
+ G_GNUC_UNUSED GtkTreeModel* model,
+ G_GNUC_UNUSED GtkTreeIter* iter)
+{
+ gboolean result;
+
+ result = TRUE;//FIXME for 548750: gtk_tree_model_iter_has_child (model, iter);
+
+ return result;
+}
+
+static gboolean
tree_model_filter_hide_show_offline (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data)
{
gboolean result = FALSE;
RosterViewGtk *self = NULL;
- GtkTreeIter child_iter;
gint column_type;
self = ROSTER_VIEW_GTK (data);
@@ -717,33 +784,17 @@
case TYPE_PRESENTITY:
- if (self->priv->show_offline_contacts)
- result = TRUE;
- else
- gtk_tree_model_get (model, iter,
- COLUMN_OFFLINE, &result,
- -1);
+ result = presentity_hide_show_offline (self, model, iter);
break;
case TYPE_GROUP:
- if (self->priv->show_offline_contacts)
- result = TRUE;
- else {
-
- if (gtk_tree_model_iter_nth_child (model, &child_iter, iter, 0)) {
- do {
-
- gtk_tree_model_get (model, &child_iter,
- COLUMN_OFFLINE, &result,
- -1);
- } while (!result && gtk_tree_model_iter_next (model, &child_iter));
- }
- }
+ result = group_hide_show_offline (self, model, iter);
break;
case TYPE_HEAP:
- result = TRUE; // FIXME for 548750: gtk_tree_model_iter_has_child (model, iter);
+
+ result = heap_hide_show_offline (self, model, iter);
break;
default:
@@ -1522,4 +1573,3 @@
(gchar*)(param_values + 2)->data[0].v_pointer,
data2);
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]