diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 5595d341..34b64827 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -89,7 +89,7 @@ namespace SparkleShare { CreateConfigurationFolders (); - UpdateRepositories (); + PopulateRepositories (); // Don't create the window and status // icon when --disable-gui was given @@ -358,7 +358,8 @@ namespace SparkleShare { Repositories.Add (repo); - Application.Invoke (delegate { NotificationIcon.CreateMenu (); }); + if (NotificationIcon != null) + Application.Invoke (delegate { NotificationIcon.CreateMenu (); }); } @@ -379,27 +380,22 @@ namespace SparkleShare { } - Application.Invoke (delegate { NotificationIcon.CreateMenu (); }); + if (NotificationIcon != null) + Application.Invoke (delegate { NotificationIcon.CreateMenu (); }); } + // Updates the list of repositories with all the // folders in the SparkleShare folder - public void UpdateRepositories () + public void PopulateRepositories () { Repositories = new List (); - foreach (string folder_path in Directory.GetDirectories (SparklePaths.SparklePath)) { - + foreach (string folder_path in Directory.GetDirectories (SparklePaths.SparklePath)) AddRepository (folder_path); - } - - // Update the list in the statusicon - if (NotificationIcon != null) - NotificationIcon.CreateMenu (); - }