fetcher: remove the Cloning prefix from the events to make more sense grammatically

This commit is contained in:
Hylke Bons 2011-05-03 18:30:39 +01:00
parent 92a1b1b627
commit f07dd48d0d
2 changed files with 17 additions and 17 deletions

View file

@ -26,13 +26,13 @@ namespace SparkleLib {
public class SparkleFetcher {
// TODO: remove 'cloning' prefix
public delegate void CloningStartedEventHandler (object o, SparkleEventArgs args);
public delegate void CloningFinishedEventHandler (object o, SparkleEventArgs args);
public delegate void CloningFailedEventHandler (object o, SparkleEventArgs args);
public delegate void StartedEventHandler (object o, SparkleEventArgs args);
public delegate void FinishedEventHandler (object o, SparkleEventArgs args);
public delegate void FailedEventHandler (object o, SparkleEventArgs args);
public event CloningStartedEventHandler CloningStarted;
public event CloningFinishedEventHandler CloningFinished;
public event CloningFailedEventHandler CloningFailed;
public event StartedEventHandler Started;
public event FinishedEventHandler Finished;
public event FailedEventHandler Failed;
private string TargetFolder;
private string RemoteOriginUrl;
@ -54,8 +54,8 @@ namespace SparkleLib {
Directory.Delete (TargetFolder, true);
if (CloningStarted != null)
CloningStarted (this, new SparkleEventArgs ("CloningStarted"));
if (Started != null)
Started (this, new SparkleEventArgs ("Started"));
SparkleGit git = new SparkleGit (SparklePaths.SparkleTmpPath,
"clone \"" + RemoteOriginUrl + "\" " + "\"" + TargetFolder + "\"");
@ -66,16 +66,16 @@ namespace SparkleLib {
if (git.ExitCode != 0) {
SparkleHelpers.DebugInfo ("Git", "[" + TargetFolder + "] Cloning failed");
if (CloningFailed != null)
CloningFailed (this, new SparkleEventArgs ("CloningFailed"));
if (Failed != null)
Failed (this, new SparkleEventArgs ("CloningFailed"));
} else {
InstallConfiguration ();
InstallExcludeRules ();
SparkleHelpers.DebugInfo ("Git", "[" + TargetFolder + "] Repository cloned");
if (CloningFinished != null)
CloningFinished (this, new SparkleEventArgs ("CloningFinished"));
if (Finished != null)
Finished (this, new SparkleEventArgs ("Finished"));
}
};

View file

@ -985,7 +985,7 @@ namespace SparkleShare {
if (i > 1)
target_folder_name += " (" + i + ")";
fetcher.CloningFinished += delegate {
fetcher.Finished += delegate {
EnableHostKeyCheckingForHost (host);
// Needed to do the moving
@ -1003,13 +1003,13 @@ namespace SparkleShare {
if (FolderFetched != null)
FolderFetched ();
if (FolderListChanged != null)
FolderListChanged ();
};
fetcher.CloningFailed += delegate {
fetcher.Failed += delegate {
EnableHostKeyCheckingForHost (host);
if (Directory.Exists (tmp_folder)) {
@ -1023,12 +1023,12 @@ namespace SparkleShare {
if (FolderFetchError != null)
FolderFetchError ();
};
fetcher.Start ();
}
// Creates an MD5 hash of input
public static string GetMD5 (string s)
{