aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-individual-view.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-26 02:35:06 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-27 18:55:27 +0800
commit2c7fdebf7a7cea6efbc0a305e681b7e7d158d821 (patch)
treed46e3f0b83c3b7bcbfe66efbf95bf3efed49c307 /libempathy-gtk/empathy-individual-view.c
parenta0d79de6f5151ee14b25364060e5dd2338f800a9 (diff)
downloadgsoc2013-empathy-2c7fdebf7a7cea6efbc0a305e681b7e7d158d821.tar
gsoc2013-empathy-2c7fdebf7a7cea6efbc0a305e681b7e7d158d821.tar.gz
gsoc2013-empathy-2c7fdebf7a7cea6efbc0a305e681b7e7d158d821.tar.bz2
gsoc2013-empathy-2c7fdebf7a7cea6efbc0a305e681b7e7d158d821.tar.lz
gsoc2013-empathy-2c7fdebf7a7cea6efbc0a305e681b7e7d158d821.tar.xz
gsoc2013-empathy-2c7fdebf7a7cea6efbc0a305e681b7e7d158d821.tar.zst
gsoc2013-empathy-2c7fdebf7a7cea6efbc0a305e681b7e7d158d821.zip
Move all individual view visibility logic into is_visible_individual()
Diffstat (limited to 'libempathy-gtk/empathy-individual-view.c')
-rw-r--r--libempathy-gtk/empathy-individual-view.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index b8365d175..25de9510f 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -1577,7 +1577,9 @@ individual_view_store_row_deleted_cb (GtkTreeModel *model,
static gboolean
individual_view_is_visible_individual (EmpathyIndividualView *self,
- FolksIndividual *individual)
+ FolksIndividual *individual,
+ gboolean is_online,
+ gboolean is_searching)
{
EmpathyIndividualViewPriv *priv = GET_PRIV (self);
EmpathyLiveSearch *live = EMPATHY_LIVE_SEARCH (priv->search_widget);
@@ -1586,8 +1588,8 @@ individual_view_is_visible_individual (EmpathyIndividualView *self,
/* We're only giving the visibility wrt filtering here, not things like
* presence. */
- if (live == NULL || gtk_widget_get_visible (GTK_WIDGET (live)) == FALSE)
- return TRUE;
+ if (is_searching == FALSE)
+ return (priv->show_offline || is_online);
/* check alias name */
str = folks_individual_get_alias (individual);
@@ -1649,10 +1651,8 @@ individual_view_filter_visible_func (GtkTreeModel *model,
if (individual != NULL)
{
- if (is_searching == TRUE)
- visible = individual_view_is_visible_individual (self, individual);
- else
- visible = (priv->show_offline || is_online);
+ visible = individual_view_is_visible_individual (self, individual,
+ is_online, is_searching);
g_object_unref (individual);
@@ -1685,12 +1685,12 @@ individual_view_filter_visible_func (GtkTreeModel *model,
if (individual == NULL)
continue;
- visible = individual_view_is_visible_individual (self, individual);
+ visible = individual_view_is_visible_individual (self, individual,
+ is_online, is_searching);
g_object_unref (individual);
/* show group if it has at least one visible contact in it */
- if ((is_searching && visible) ||
- (!is_searching && (priv->show_offline || is_online)))
+ if (visible == TRUE)
return TRUE;
}