lib: Code cleanup

This commit is contained in:
Hylke Bons 2012-07-22 11:51:56 +02:00
parent 9870ea4475
commit 7d9e963c73
2 changed files with 17 additions and 25 deletions

View file

@ -154,27 +154,25 @@ namespace SparkleLib {
AcceptHostKey (host_key, warn); AcceptHostKey (host_key, warn);
this.thread = new Thread ( this.thread = new Thread (() => {
new ThreadStart (delegate { if (Fetch ()) {
if (Fetch ()) { Thread.Sleep (500);
Thread.Sleep (500); SparkleHelpers.DebugInfo ("Fetcher", "Finished");
SparkleHelpers.DebugInfo ("Fetcher", "Finished");
IsActive = false; IsActive = false;
// TODO: Find better way to determine if folder should have crypto setup // TODO: Find better way to determine if folder should have crypto setup
bool repo_is_encrypted = RemoteUrl.ToString ().Contains ("crypto"); bool repo_is_encrypted = RemoteUrl.ToString ().Contains ("crypto");
Finished (repo_is_encrypted, IsFetchedRepoEmpty, Warnings); Finished (repo_is_encrypted, IsFetchedRepoEmpty, Warnings);
} else { } else {
Thread.Sleep (500); Thread.Sleep (500);
SparkleHelpers.DebugInfo ("Fetcher", "Failed"); SparkleHelpers.DebugInfo ("Fetcher", "Failed");
IsActive = false; IsActive = false;
Failed (); Failed ();
} }
}) });
);
this.thread.Start (); this.thread.Start ();
} }
@ -238,7 +236,7 @@ namespace SparkleLib {
return new string (letters); return new string (letters);
} else { } else {
return "Git"; return "Git";
} }
} }

View file

@ -61,13 +61,7 @@ namespace SparkleLib {
if (repo.Name.Equals (repo_name) && !repo.IsBuffering && if (repo.Name.Equals (repo_name) && !repo.IsBuffering &&
(repo.Status != SyncStatus.SyncUp && repo.Status != SyncStatus.SyncDown)) { (repo.Status != SyncStatus.SyncUp && repo.Status != SyncStatus.SyncDown)) {
Thread thread = new Thread ( new Thread (() => repo.OnFileActivity (args)).Start ();
new ThreadStart (delegate {
repo.OnFileActivity (args);
})
);
thread.Start ();
} }
} }
} }