[bijiben] controller: if no item is found, still add the note



commit db3acb6b625f3c68fd4d70ae1e906afb774ad933
Author: Pierre-Yves Luyten <py luyten fr>
Date:   Tue May 21 00:34:46 2013 +0200

    controller: if no item is found, still add the note
    
    We now check for the first note to preppend. But if nothing
    is found, add it however

 src/bjb-controller.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/bjb-controller.c b/src/bjb-controller.c
index b2c7678..cc59013 100644
--- a/src/bjb-controller.c
+++ b/src/bjb-controller.c
@@ -203,15 +203,18 @@ bjb_controller_get_iter (BjbController *self,
 {
   BjbControllerPrivate *priv = self->priv;
   gboolean retval = FALSE;
-  gboolean still;
+  gboolean try;
   const gchar *needle = NULL;
 
   if (item && BIJI_IS_ITEM (item))
       needle = biji_item_get_uuid (item);
 
-  still = gtk_tree_model_get_iter_first (priv->model, *iter);
+  try = gtk_tree_model_get_iter_first (priv->model, *iter);
 
-  while (still)
+  if (!try)
+    *iter = NULL;
+
+  while (try)
   {
     gchar *item_path;
     gtk_tree_model_get (priv->model, *iter, GD_MAIN_COLUMN_URI, &item_path,-1);
@@ -231,7 +234,7 @@ bjb_controller_get_iter (BjbController *self,
       break;
 
     else
-      still = gtk_tree_model_iter_next (priv->model, *iter);
+      try = gtk_tree_model_iter_next (priv->model, *iter);
   }
 
   return retval;


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