From 508092e0f1ea83da2a6026ba242874efa42643ca Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 15 Apr 2012 16:58:39 +0200 Subject: [PATCH] config: remove old and unused methods --- SparkleLib/SparkleConfig.cs | 60 ++++--------------------------------- 1 file changed, 6 insertions(+), 54 deletions(-) diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index 17327cf2..13eddbd7 100755 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -29,15 +29,14 @@ namespace SparkleLib { Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "sparkleshare"); - // TODO: declare elsewhere public static SparkleConfig DefaultConfig = new SparkleConfig (default_config_path, "config.xml"); public static bool DebugMode = true; - public string FullPath; public string TmpPath; public string LogFilePath; + public string HomePath { get { if (GetConfigOption ("home_path") != null) { @@ -60,6 +59,7 @@ namespace SparkleLib { } } + public string FoldersPath { get { if (GetConfigOption ("folders_path") != null) @@ -69,6 +69,7 @@ namespace SparkleLib { } } + public SparkleConfig (string config_path, string config_file_name) { try { @@ -205,8 +206,6 @@ namespace SparkleLib { email_node.InnerText = user.Email; Save (); - - // ConfigureSSH (); } } @@ -313,44 +312,6 @@ namespace SparkleLib { } - public List Hosts { - get { - List hosts = new List (); - - foreach (XmlNode node_folder in SelectNodes ("/sparkleshare/folder")) { - Uri uri = new Uri (node_folder ["url"].InnerText); - - if (!hosts.Contains (uri.Host)) - hosts.Add (uri.Host); - } - - return hosts; - } - } - - - public List HostsWithUsername { - get { - List hosts = new List (); - - foreach (XmlNode node_folder in SelectNodes ("/sparkleshare/folder")) { - try { - Uri uri = new Uri (node_folder ["url"].InnerText); - - if (uri.UserInfo != "git" && !hosts.Contains (uri.UserInfo + "@" + uri.Host)) - hosts.Add (uri.UserInfo + "@" + uri.Host); - - } catch (UriFormatException) { - SparkleHelpers.DebugInfo ("Config", - "Ignoring badly formatted URI: " + node_folder ["url"].InnerText); - } - } - - return hosts; - } - } - - private XmlNode GetFolder (string name) { return SelectSingleNode (String.Format("/sparkleshare/folder[name='{0}']", name)); @@ -408,23 +369,14 @@ namespace SparkleLib { Save (FullPath); SparkleHelpers.DebugInfo ("Config", "Updated \"" + FullPath + "\""); } - - - private void Chmod644 (string file_path) - { - // Hack to be able to set the permissions on a file - // that OpenSSH still likes without resorting to Mono.Unix - FileInfo file_info = new FileInfo (file_path); - file_info.Attributes = FileAttributes.ReadOnly; - file_info.Attributes = FileAttributes.Normal; - } } public class ConfigFileNotFoundException : Exception { - public ConfigFileNotFoundException (string message) : - base (message) { } + public ConfigFileNotFoundException (string message) : base (message) + { + } } }