repo: Fix a few race conditions updating the status icon

This commit is contained in:
Hylke Bons 2013-06-13 17:51:24 +01:00
parent 69c6b04ecf
commit 714ac3ea83

View file

@ -186,6 +186,11 @@ namespace SparkleLib {
// changes or the server was down, sync up again
if (HasUnsyncedChanges && !this.is_syncing && Error == ErrorStatus.None)
SyncUpBase ();
if (Status != SyncStatus.Idle && Status != Error) {
Status = SyncStatus.Idle;
SyncStatusChanged (Status);
}
};
}
@ -273,8 +278,9 @@ namespace SparkleLib {
first_sync = false;
} while (HasLocalChanges);
}
} else {
if (Status != SyncStatus.Idle && Status != Error) {
Status = SyncStatus.Idle;
SyncStatusChanged (Status);
}
@ -392,11 +398,10 @@ namespace SparkleLib {
string pre_sync_revision = CurrentRevision;
if (SyncDown ()) {
SparkleLogger.LogInfo ("SyncDown", Name + " | Done");
Error = ErrorStatus.None;
string identifier_file_path = Path.Combine (LocalPath, ".sparkleshare");
File.SetAttributes (identifier_file_path, FileAttributes.Hidden);
string identifier_file_path = Path.Combine (LocalPath, ".sparkleshare");
File.SetAttributes (identifier_file_path, FileAttributes.Hidden);
ChangeSets = GetChangeSets ();
@ -417,6 +422,8 @@ namespace SparkleLib {
NewChangeSet (ChangeSets [0]);
}
SparkleLogger.LogInfo ("SyncDown", Name + " | Done");
// There could be changes from a resolved
// conflict. Tries only once, then lets
// the timer try again periodically