[ui] be more efficient populating and fix threading issue
This commit is contained in:
parent
82312a4e49
commit
ac8828e7a0
|
@ -89,7 +89,7 @@ namespace SparkleShare {
|
|||
|
||||
|
||||
CreateConfigurationFolders ();
|
||||
UpdateRepositories ();
|
||||
PopulateRepositories ();
|
||||
|
||||
// Don't create the window and status
|
||||
// icon when --disable-gui was given
|
||||
|
@ -358,6 +358,7 @@ namespace SparkleShare {
|
|||
|
||||
Repositories.Add (repo);
|
||||
|
||||
if (NotificationIcon != null)
|
||||
Application.Invoke (delegate { NotificationIcon.CreateMenu (); });
|
||||
|
||||
}
|
||||
|
@ -379,29 +380,24 @@ namespace SparkleShare {
|
|||
|
||||
}
|
||||
|
||||
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 <SparkleRepo> ();
|
||||
|
||||
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 ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Warns the user implicitly that unicorns are actually lethal creatures
|
||||
public static void CheckForUnicorns (string message) {
|
||||
|
|
Loading…
Reference in a new issue