[blam] ItemList: oops, include changes to Next() and remove old code



commit b9d324719ba76856b9f55a2e5d5fa800efe6fa0e
Author: Carlos MartÃn Nieto <cmn dwim me>
Date:   Wed Jan 16 01:30:56 2013 +0100

    ItemList: oops, include changes to Next() and remove old code

 src/ItemList.cs |   50 ++++----------------------------------------------
 1 files changed, 4 insertions(+), 46 deletions(-)
---
diff --git a/src/ItemList.cs b/src/ItemList.cs
index 7335e4d..fac1dab 100644
--- a/src/ItemList.cs
+++ b/src/ItemList.cs
@@ -102,7 +102,7 @@ namespace Imendio.Blam {
 			return false;
 		}
 
-		public void Next(bool unread = true)
+		public bool Next(bool unread = true)
 		{
 			TreeModel model;
 			TreeIter  iter;
@@ -118,55 +118,13 @@ namespace Imendio.Blam {
 			else
 				check = (_) => true;
 
-			if (LoopItems(model, out iter, check))
+			if (LoopItems(model, out iter, check)) {
 				ScrollTo(iter);
+				return true;
+			}
 
-		}
-
-	public bool IdleScrollCb ()
-	{
-	    TreeIter iter;
-	    TreeIter lastIter = TreeIter.Zero;
-	    TreePath path = null;
-
-	    if (!this.Model.GetIterFirst (out iter)) {
-		// No items 
-		return false;
-	    }
-
-	    bool reverse = Conf.Get (Preference.REVERSE_ENTRIES, false);
-	    
-	    do {
-		Item item = (Item) this.Model.GetValue (iter, 0);
-		if (item.Unread) {
-		    if (((ListStore)this.Model).IterIsValid (lastIter)) {
-			path = this.Model.GetPath (lastIter);
-		    } else {
-			path = this.Model.GetPath (iter);
-		    }
-		    break;
-		} 
-		lastIter = iter;
-	    } while (this.Model.IterNext (ref iter));
-	   
-	    if (path == null) { 
-		if (reverse) {
-		    path = TreePath.NewFirst ();
-		} else {
-		    if (!((ListStore)this.Model).IterIsValid (lastIter)) {
 			return false;
-		    }
-		
-		    path = this.Model.GetPath (lastIter);
 		}
-	    }
-
-	    if (path != null) {
-		ScrollToCell (path, titleColumn, true, 0, 0);
-	    }
-	    
-	    return false;
-	}
 
 		public void UpdateList ()
 		{



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