Code cleanup

This commit is contained in:
Hylke Bons 2011-06-03 00:35:51 +01:00
parent e0b622b8ef
commit 85be7121ab
3 changed files with 28 additions and 35 deletions

View file

@ -34,14 +34,7 @@ namespace SparkleLib {
public abstract class SparkleRepoBase { public abstract class SparkleRepoBase {
public readonly SparkleBackend Backend;
public readonly string LocalPath;
public readonly string Name;
protected SyncStatus status;
protected bool is_buffering = false;
protected bool is_polling = true;
protected bool server_online = true;
private Timer local_timer = new Timer () { Interval = 250 }; private Timer local_timer = new Timer () { Interval = 250 };
private Timer remote_timer = new Timer () { Interval = 60000 }; private Timer remote_timer = new Timer () { Interval = 60000 };
@ -51,6 +44,15 @@ namespace SparkleLib {
private bool has_changed = false; private bool has_changed = false;
private Object change_lock = new Object (); private Object change_lock = new Object ();
protected SyncStatus status;
protected bool is_buffering = false;
protected bool is_polling = true;
protected bool server_online = true;
public readonly SparkleBackend Backend;
public readonly string LocalPath;
public readonly string Name;
public abstract bool AnyDifferences { get; } public abstract bool AnyDifferences { get; }
public abstract string Identifier { get; } public abstract string Identifier { get; }
public abstract string CurrentRevision { get; } public abstract string CurrentRevision { get; }

View file

@ -215,29 +215,23 @@ namespace SparkleShare {
AddressTextField.Enabled = (ServerType == 0); AddressTextField.Enabled = (ServerType == 0);
switch (ServerType) { switch (ServerType) {
case 0:
case 0: AddressTextField.StringValue = "";
AddressTextField.StringValue = ""; FolderNameHelpLabel.StringValue = "e.g. rupert/website-design";
FolderNameHelpLabel.StringValue = "e.g. rupert/website-design"; break;
break; case 1:
AddressTextField.StringValue = "ssh://git@github.com/";
case 1: FolderNameHelpLabel.StringValue = "e.g. rupert/website-design";
AddressTextField.StringValue = "ssh://git@github.com/"; break;
FolderNameHelpLabel.StringValue = "e.g. rupert/website-design"; case 2:
break; AddressTextField.StringValue = "ssh://git@gitorious.org/";
FolderNameHelpLabel.StringValue = "e.g. project/website-design";
case 2: break;
AddressTextField.StringValue = "ssh://git@gitorious.org/"; case 3:
FolderNameHelpLabel.StringValue = "e.g. project/website-design"; AddressTextField.StringValue = "ssh://git@gnome.org/git/";
break; FolderNameHelpLabel.StringValue = "e.g. gnome-icon-theme";
break;
case 3:
AddressTextField.StringValue = "ssh://git@gnome.org/git/";
FolderNameHelpLabel.StringValue = "e.g. gnome-icon-theme";
break;
} }
} }
@ -251,12 +245,9 @@ namespace SparkleShare {
SyncButton.Enabled = true; SyncButton.Enabled = true;
} else { } else {
SyncButton.Enabled = false; SyncButton.Enabled = false;
}
}
}); });
}; };

View file

@ -30,6 +30,7 @@ namespace SparkleShare {
private DirectoryInfo last_changed; private DirectoryInfo last_changed;
public SparkleMacWatcher (string path) public SparkleMacWatcher (string path)
{ {
Thread thread = new Thread (new ThreadStart (delegate { Thread thread = new Thread (new ThreadStart (delegate {
@ -75,4 +76,3 @@ namespace SparkleShare {
} }
} }
} }