repo: don't show notifications for changes that you made yourself elsewhere

This commit is contained in:
Hylke Bons 2013-01-20 12:40:24 +00:00
parent 1875041f76
commit b5bf4a21b5
2 changed files with 8 additions and 15 deletions

View file

@ -386,7 +386,10 @@ namespace SparkleLib {
ChangeSets = GetChangeSets (); ChangeSets = GetChangeSets ();
if (!pre_sync_revision.Equals (CurrentRevision) && ChangeSets != null && ChangeSets.Count > 0) { if (!pre_sync_revision.Equals (CurrentRevision) &&
ChangeSets != null && ChangeSets.Count > 0 &&
!ChangeSets [0].User.Name.Equals (this.local_config.User.Name)) {
bool emit_change_event = true; bool emit_change_event = true;
foreach (SparkleChange change in ChangeSets [0].Changes) { foreach (SparkleChange change in ChangeSets [0].Changes) {

View file

@ -51,22 +51,12 @@ namespace SparkleLib {
case SparkleChangeType.Moved: message = "moved {0}"; break; case SparkleChangeType.Moved: message = "moved {0}"; break;
} }
if (Changes.Count == 1) { if (Changes.Count > 0)
return message = string.Format (message, Changes [0].Path); return string.Format (message, Changes [0].Path);
} else if (Changes.Count > 1) {
message = string.Format (message, Changes [0].Path);
if ((Changes.Count - 1) == 1)
return string.Format (message + " and one other event", Changes.Count - 1);
else else
return string.Format (message + " and {0} other events", Changes.Count - 1);
} else {
return "did something magical"; return "did something magical";
} }
} }
}
public class SparkleChange { public class SparkleChange {