[empathy: 43/80] Return early if the iter isn't a top level
- From: Emilio Pozuelo Monfort <epm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy: 43/80] Return early if the iter isn't a top level
- Date: Fri, 10 Jun 2011 08:42:46 +0000 (UTC)
commit ece7f43a1a51c679fdd9419411c3593ddb597354
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date: Wed Apr 27 10:47:45 2011 +0100
Return early if the iter isn't a top level
libempathy-gtk/empathy-log-window.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index b1962cb..b64db82 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -613,12 +613,11 @@ model_is_parent (GtkTreeModel *model,
TplEvent *stored_event;
TplEntity *target;
TpAccount *account;
- gint64 timestamp;
gboolean found = FALSE;
- GtkTreeIter parent, child;
- gboolean is_toplevel;
+ GtkTreeIter parent;
- is_toplevel = !gtk_tree_model_iter_parent (model, &parent, iter);
+ if (gtk_tree_model_iter_parent (model, &parent, iter))
+ return FALSE;
gtk_tree_model_get (model, iter,
COL_EVENTS_ACCOUNT, &account,
@@ -626,12 +625,14 @@ model_is_parent (GtkTreeModel *model,
COL_EVENTS_EVENT, &stored_event,
-1);
- if (is_toplevel &&
- G_OBJECT_TYPE (event) == G_OBJECT_TYPE (stored_event) &&
+ if (G_OBJECT_TYPE (event) == G_OBJECT_TYPE (stored_event) &&
account_equal (account, tpl_event_get_account (event)) &&
(entity_equal (target, event_get_target (event)) ||
is_same_confroom (event, stored_event)))
{
+ GtkTreeIter child;
+ gint64 timestamp;
+
gtk_tree_model_iter_nth_child (model, &child, iter,
gtk_tree_model_iter_n_children (model, iter) - 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]