From 85be7121ab3edaf2aa79685ba798cdc288d35827 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 3 Jun 2011 00:35:51 +0100 Subject: [PATCH] Code cleanup --- SparkleLib/SparkleRepoBase.cs | 16 +++++----- SparkleShare/Mac/SparkleIntro.cs | 45 +++++++++++---------------- SparkleShare/Mac/SparkleMacWatcher.cs | 2 +- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 84ff4af9..de4cd678 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -34,14 +34,7 @@ namespace SparkleLib { 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 remote_timer = new Timer () { Interval = 60000 }; @@ -51,6 +44,15 @@ namespace SparkleLib { private bool has_changed = false; 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 string Identifier { get; } public abstract string CurrentRevision { get; } diff --git a/SparkleShare/Mac/SparkleIntro.cs b/SparkleShare/Mac/SparkleIntro.cs index e14e9ad1..db7ea759 100644 --- a/SparkleShare/Mac/SparkleIntro.cs +++ b/SparkleShare/Mac/SparkleIntro.cs @@ -215,29 +215,23 @@ namespace SparkleShare { AddressTextField.Enabled = (ServerType == 0); switch (ServerType) { - - case 0: - AddressTextField.StringValue = ""; - FolderNameHelpLabel.StringValue = "e.g. ‘rupert/website-design’"; - break; - - case 1: - AddressTextField.StringValue = "ssh://git@github.com/"; - FolderNameHelpLabel.StringValue = "e.g. ‘rupert/website-design’"; - break; - - case 2: - AddressTextField.StringValue = "ssh://git@gitorious.org/"; - FolderNameHelpLabel.StringValue = "e.g. ‘project/website-design’"; - break; - - case 3: - AddressTextField.StringValue = "ssh://git@gnome.org/git/"; - FolderNameHelpLabel.StringValue = "e.g. ‘gnome-icon-theme’"; - break; - + case 0: + AddressTextField.StringValue = ""; + FolderNameHelpLabel.StringValue = "e.g. ‘rupert/website-design’"; + break; + case 1: + AddressTextField.StringValue = "ssh://git@github.com/"; + FolderNameHelpLabel.StringValue = "e.g. ‘rupert/website-design’"; + break; + case 2: + AddressTextField.StringValue = "ssh://git@gitorious.org/"; + FolderNameHelpLabel.StringValue = "e.g. ‘project/website-design’"; + 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; - } else { - + } else { SyncButton.Enabled = false; - - } - + } }); }; diff --git a/SparkleShare/Mac/SparkleMacWatcher.cs b/SparkleShare/Mac/SparkleMacWatcher.cs index 324e7f65..1d8c85fd 100644 --- a/SparkleShare/Mac/SparkleMacWatcher.cs +++ b/SparkleShare/Mac/SparkleMacWatcher.cs @@ -30,6 +30,7 @@ namespace SparkleShare { private DirectoryInfo last_changed; + public SparkleMacWatcher (string path) { Thread thread = new Thread (new ThreadStart (delegate { @@ -75,4 +76,3 @@ namespace SparkleShare { } } } -