oQj45pN1dw2wemY0G8OtqxKqOeiaczy6R9Uy5eD5Ldfx3m3c48zSgzPFFYW8EQM94TcG//4uPZIiJVA9GnrlINOsmUJvqJTAepep8itjlY/MyeQUxqyfYNW1vecz/X8sgmAbWk2XBZM8Enf3UqtYvWP7+zOt4sqCLpWnm+7nzy0=EQ==sIQ90D2XsEXpxLDmUnzISsHrcDS4+cmhRq8Jb91Kd/Kk+CPEVthIvUeYmCoNnWP3BdccaeDK6PFz0Db06r/nqw==
6YwdeMA0LL4wEFBMT7BfC7PFXyA1w5q1+9jEXb9/QWlI177B2Sb0CHQ5XbifeZws5p+XMWo/4vNqXcVWn2nshw==
fJmVC3bFbV6G5TGThYVCFqcAi3CCkjP5XxIkx28HY7pWVM30AREkSV+3Af+RI84Xx+MjHY+eShPZR65Sh5aFaQ==Um2wDIASaiUB56Pesra4Ij9y1keagUWppC5jbGG0cXB0D+j5H3co8+zI8+bO36CIUWWAqAdh16E0mZDxZXCt1Q==TAlt1Bz3uoh20LyceZ2tvXBP+qkeR2iny0YA8IZPNeXYK9J+/grFJx4fBS7Y9h6zgWTJyDfv7ocLpGctJd+rgg==eyT6kjSHALAdisagUXeEzh1U/xtI7rX33JP5vtk3BPBtqhfHCI2R69xLas+t7uRcfwv2S0nnIAZWWMTjbpo2vYZoa6CiXX1x76PqdFneVEn3T2o4WdUPB1JubE/N+moX+SL+R9plAveAMVRqJERDwKaxNr/THaSWaqmhH1wYzv0=
\ No newline at end of file
diff --git a/SparkleShare/SparkleRepo.cs b/SparkleShare/SparkleRepo.cs
index 291142ba..39171b5d 100644
--- a/SparkleShare/SparkleRepo.cs
+++ b/SparkleShare/SparkleRepo.cs
@@ -35,6 +35,7 @@ namespace SparkleShare {
private FileSystemWatcher Watcher;
private bool HasChanged = false;
private DateTime LastChange;
+ private System.Object ChangeLock = new System.Object();
public string Name;
public string Domain;
@@ -126,14 +127,16 @@ namespace SparkleShare {
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) {
SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Checking for changes.");
- if (HasChanged) {
- SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Changes found, checking if settled.");
- DateTime now = DateTime.UtcNow;
- TimeSpan changed = new TimeSpan (now.Ticks - LastChange.Ticks);
- if (changed.TotalMilliseconds > 5000) {
- HasChanged = false;
- SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Changes have settled, adding.");
- AddCommitAndPush ();
+ lock(ChangeLock) {
+ if (HasChanged) {
+ SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Changes found, checking if settled.");
+ DateTime now = DateTime.UtcNow;
+ TimeSpan changed = new TimeSpan (now.Ticks - LastChange.Ticks);
+ if (changed.TotalMilliseconds > 5000) {
+ HasChanged = false;
+ SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Changes have settled, adding.");
+ AddCommitAndPush ();
+ }
}
}
};
@@ -156,8 +159,10 @@ namespace SparkleShare {
if (!ShouldIgnore (args.Name)) {
SparkleHelpers.DebugInfo ("Event", "[" + Name + "] " + wct.ToString () + " '" + args.Name + "'");
FetchTimer.Stop ();
- LastChange = DateTime.UtcNow;
- HasChanged = true;
+ lock(ChangeLock) {
+ LastChange = DateTime.UtcNow;
+ HasChanged = true;
+ }
}
}
@@ -165,21 +170,23 @@ namespace SparkleShare {
// so this method does them all with appropriate timers, etc switched off
public void AddCommitAndPush ()
{
- BufferTimer.Stop ();
- FetchTimer.Stop ();
-
- Add ();
- string Message = FormatCommitMessage ();
- if (!Message.Equals ("")) {
- Commit (Message);
- Fetch ();
- Push ();
+ try {
+ BufferTimer.Stop ();
+ FetchTimer.Stop ();
+
+ Add ();
+ string Message = FormatCommitMessage ();
+ if (!Message.Equals ("")) {
+ Commit (Message);
+ Fetch ();
+ Push ();
+// SparkleHelpers.CheckForUnicorns (Message);
+ }
+ }
+ finally {
+ FetchTimer.Start ();
+ BufferTimer.Start ();
}
-
- FetchTimer.Start ();
- BufferTimer.Start ();
-
- CheckForUnicorns (Message);
}
@@ -207,18 +214,22 @@ namespace SparkleShare {
// Fetches changes from the remote repo
public void Fetch ()
{
- FetchTimer.Stop ();
-// SparkleUI.NotificationIcon.SetSyncingState ();
- SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Fetching changes...");
- Process.StartInfo.Arguments = "fetch -v";
- Process.Start ();
- string Output = Process.StandardOutput.ReadToEnd ().Trim (); // TODO: This doesn't work :(
- Process.WaitForExit ();
- SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Changes fetched.");
- if (!Output.Contains ("up to date"))
- Rebase ();
-// SparkleUI.NotificationIcon.SetIdleState ();
- FetchTimer.Start ();
+ try {
+ FetchTimer.Stop ();
+// SparkleUI.NotificationIcon.SetSyncingState ();
+ SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Fetching changes...");
+ Process.StartInfo.Arguments = "fetch -v";
+ Process.Start ();
+ string Output = Process.StandardOutput.ReadToEnd ().Trim (); // TODO: This doesn't work :(
+ Process.WaitForExit ();
+ SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Changes fetched.");
+ if (!Output.Contains ("up to date"))
+ Rebase ();
+// SparkleUI.NotificationIcon.SetIdleState ();
+ }
+ finally {
+ FetchTimer.Start ();
+ }
}
// Merges the fetched changes
@@ -270,10 +281,10 @@ namespace SparkleShare {
string ConflictTitle = "A mid-air collision happened!\n";
string ConflictSubtext = "Don't worry, SparkleShare made\na copy of the conflicting files.";
- SparkleBubble ConflictBubble =
- new SparkleBubble(_(ConflictTitle), _(ConflictSubtext));
+// SparkleBubble ConflictBubble =
+ // new SparkleBubble(_(ConflictTitle), _(ConflictSubtext));
- ConflictBubble.Show ();
+ // ConflictBubble.Show ();
}
@@ -312,11 +323,11 @@ namespace SparkleShare {
SparkleHelpers.DebugInfo ("Notification", "[" + Name + "] Showing message...");
- SparkleBubble StuffChangedBubble = new SparkleBubble (LastCommitUserName, LastCommitMessage);
- StuffChangedBubble.Icon = SparkleHelpers.GetAvatar (LastCommitEmail, 32);
+// SparkleBubble StuffChangedBubble = new SparkleBubble (LastCommitUserName, LastCommitMessage);
+ // StuffChangedBubble.Icon = SparkleHelpers.GetAvatar (LastCommitEmail, 32);
// Add a button to open the folder where the changed file is
- StuffChangedBubble.AddAction ("", _("Open Folder"),
+ /* StuffChangedBubble.AddAction ("", _("Open Folder"),
delegate {
switch (SparklePlatform.Name) {
case "GNOME":
@@ -332,7 +343,7 @@ namespace SparkleShare {
} );
StuffChangedBubble.Show ();
-
+*/
}
}
@@ -467,8 +478,8 @@ namespace SparkleShare {
string subtext = _("SparkleShare is known to be insanely fast with \n" +
"pictures of unicorns. Please make sure your internets\n" +
"are upgraded to the latest version to avoid problems.");
- SparkleBubble unicorn_bubble = new SparkleBubble (title, subtext);
- unicorn_bubble.Show ();
+// SparkleBubble unicorn_bubble = new SparkleBubble (title, subtext);
+ // unicorn_bubble.Show ();
}
}
diff --git a/po/de.po b/po/de.po
index 9490e11d..63b7e533 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: SparkleShare 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-07-05 06:00+0000\n"
+"POT-Creation-Date: 2010-07-12 05:53+0000\n"
"PO-Revision-Date: 2010-06-21 16:26+0100\n"
"Last-Translator: Martin Lettner