repo: Keep a list of unsynced files

This commit is contained in:
Hylke Bons 2014-10-28 22:59:57 +01:00
parent 0d0dddd033
commit 0cb7647795
2 changed files with 17 additions and 7 deletions

View file

@ -761,6 +761,13 @@ namespace SparkleLib.Git {
}
public override List<SparkleChange> UnsyncedChanges {
get {
return ParseStatus ();
}
}
public override List<SparkleChangeSet> GetChangeSets ()
{
return GetChangeSetsInternal (null);
@ -1136,11 +1143,8 @@ namespace SparkleLib.Git {
git_status.StandardOutput.ReadToEnd ();
git_status.WaitForExit ();
if (changes.Count == 0)
return null;
else
return changes;
return changes;
}

View file

@ -60,6 +60,7 @@ namespace SparkleLib {
public abstract double HistorySize { get; }
public abstract List<string> ExcludePaths { get; }
public abstract List<SparkleChange> UnsyncedChanges { get; }
public abstract List<SparkleChangeSet> GetChangeSets ();
public abstract List<SparkleChangeSet> GetChangeSets (string path);
@ -83,7 +84,7 @@ namespace SparkleLib {
public readonly string LocalPath;
public readonly string Name;
public readonly Uri RemoteUrl;
public List<SparkleChangeSet> ChangeSets { get; protected set; }
public List<SparkleChangeSet> ChangeSets { get; private set; }
public SyncStatus Status { get; private set; }
public ErrorStatus Error { get; protected set; }
public bool IsBuffering { get; private set; }
@ -229,7 +230,7 @@ namespace SparkleLib {
public void OnFileActivity (FileSystemEventArgs args)
{
if (IsBuffering || this.is_syncing || Status == SyncStatus.Paused)
if (IsBuffering || this.is_syncing)
return;
if (args != null) {
@ -238,6 +239,11 @@ namespace SparkleLib {
return;
}
}
if (Status == SyncStatus.Paused) {
ChangesDetected ();
return;
}
lock (this.buffer_lock) {
if (IsBuffering || this.is_syncing || !HasLocalChanges)