[gitg/commit: 4/7] Allow fetching all status files in one time
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/commit: 4/7] Allow fetching all status files in one time
- Date: Sat, 29 Jun 2013 12:48:59 +0000 (UTC)
commit b310e52dbc5d953cdec925e2f7c11f09d9ffb5d4
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Jun 29 14:44:31 2013 +0200
Allow fetching all status files in one time
libgitg/gitg-stage-status-enumerator.vala | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/libgitg/gitg-stage-status-enumerator.vala b/libgitg/gitg-stage-status-enumerator.vala
index 5b22299..737a2cf 100644
--- a/libgitg/gitg-stage-status-enumerator.vala
+++ b/libgitg/gitg-stage-status-enumerator.vala
@@ -88,7 +88,7 @@ public class StageStatusEnumerator : Object
{
d_files += new StageStatusFile(path, flags);
- if (d_callback != null && d_files.length >= d_callback_num)
+ if (d_callback != null && d_callback_num != -1 && d_files.length >=
d_callback_num)
{
var cb = (owned)d_callback;
d_callback = null;
@@ -109,6 +109,14 @@ public class StageStatusEnumerator : Object
lock (d_files)
{
d_cancellable = null;
+
+ if (d_callback != null && d_callback_num == -1)
+ {
+ var cb = (owned)d_callback;
+ d_callback = null;
+
+ Idle.add((owned)cb);
+ }
}
return null;
@@ -118,6 +126,11 @@ public class StageStatusEnumerator : Object
{
int n = 0;
+ if (num == -1)
+ {
+ num = d_files.length - d_offset;
+ }
+
StageStatusFile[] ret = new StageStatusFile[int.min(num, d_files.length - d_offset)];
ret.length = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]