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

View file

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