[gitg/vala] Construct lanes while loading commit model



commit 1c195ec60cccb3b31645141d1a13556318adacbc
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Sun Apr 22 15:11:21 2012 +0200

    Construct lanes while loading commit model

 libgitg/gitg-commit-model.vala |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libgitg/gitg-commit-model.vala b/libgitg/gitg-commit-model.vala
index 9ead638..7019349 100644
--- a/libgitg/gitg-commit-model.vala
+++ b/libgitg/gitg-commit-model.vala
@@ -10,6 +10,7 @@ public class CommitModel : Object
 	private Ggit.RevisionWalker? d_walker;
 	private uint d_advertized_size;
 	private uint d_idleid;
+	private Lanes d_lanes;
 
 	public uint limit { get; set; }
 
@@ -37,6 +38,11 @@ public class CommitModel : Object
 		d_repository = repository;
 	}
 
+	construct
+	{
+		d_lanes = new Lanes();
+	}
+
 	~CommitModel()
 	{
 		cancel();
@@ -80,6 +86,7 @@ public class CommitModel : Object
 
 	protected virtual void emit_started()
 	{
+		d_lanes.reset();
 		started();
 	}
 
@@ -254,6 +261,11 @@ public class CommitModel : Object
 
 				d_ids += commit;
 
+				int mylane;
+				var lanes = d_lanes.next(commit, out mylane);
+
+				commit.update_lanes((owned)lanes, mylane);
+
 				if (timer.elapsed() >= 200)
 				{
 					notify_batch(false);



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