diff --git a/SparkleLib/SparklePaths.cs b/SparkleLib/SparklePaths.cs index 7c648c36..3c550973 100644 --- a/SparkleLib/SparklePaths.cs +++ b/SparkleLib/SparklePaths.cs @@ -16,11 +16,8 @@ using System; -using System.Diagnostics; using System.IO; -using Mono.Unix; - namespace SparkleLib { public static class SparklePaths { @@ -30,7 +27,7 @@ namespace SparkleLib { public static string SparkleTmpPath = Path.Combine (SparklePath, ".tmp"); public static string SparkleConfigPath = Path.Combine (Environment.GetFolderPath ( Environment.SpecialFolder.ApplicationData), "sparkleshare"); - public static string SparkleLocalIconPath = SparkleHelpers.CombineMore (SparkleConfigPath, "icons"); + public static string SparkleLocalIconPath = Path.Combine (SparkleConfigPath, "icons"); public static string SparkleInstallPath = Path.Combine (Defines.PREFIX, "sparkleshare"); public static string SparkleIconPath = SparkleHelpers.CombineMore (Defines.DATAROOTDIR, "sparkleshare", "icons"); diff --git a/SparkleShare/Mac/SparkleMacController.cs b/SparkleShare/Mac/SparkleMacController.cs index 02ba8954..baa9f3bd 100644 --- a/SparkleShare/Mac/SparkleMacController.cs +++ b/SparkleShare/Mac/SparkleMacController.cs @@ -32,9 +32,12 @@ namespace SparkleShare { // System.IO.FileSystemWatcher fails watching subfolders on Mac private SparkleMacWatcher watcher = new SparkleMacWatcher (SparklePaths.SparklePath); + public SparkleMacController () : base () { } - public SparkleMacController () : base () + new public void Initialize () { + base.Initialize (); + watcher.Changed += delegate (string path) { string repo_name; diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 3cf0785e..b32d439d 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -35,7 +35,7 @@ namespace SparkleShare { public List Repositories; public string FolderSize; - public readonly string SparklePath; + public readonly string SparklePath = SparklePaths.SparklePath; public event OnQuitWhileSyncingEventHandler OnQuitWhileSyncing; public delegate void OnQuitWhileSyncingEventHandler (); @@ -88,10 +88,10 @@ namespace SparkleShare { } - public SparkleController () - { - SparklePath = SparklePaths.SparklePath; + public SparkleController () { } + public void Initialize () + { InstallLauncher (); EnableSystemAutostart (); diff --git a/SparkleShare/SparkleShare.cs b/SparkleShare/SparkleShare.cs index 448e6a9f..3b4d48b7 100644 --- a/SparkleShare/SparkleShare.cs +++ b/SparkleShare/SparkleShare.cs @@ -99,6 +99,8 @@ namespace SparkleShare { // there aren't any exceptions in the OS specific UI's Controller = (SparkleController) Activator.CreateInstance ( Type.GetType ("SparkleShare.Sparkle" + controller_name + "Controller")); + + Controller.Initialize (); if (Controller != null && !hide_ui) { UI = new SparkleUI ();