[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 ();
|
CreateConfigurationFolders ();
|
||||||
UpdateRepositories ();
|
PopulateRepositories ();
|
||||||
|
|
||||||
// Don't create the window and status
|
// Don't create the window and status
|
||||||
// icon when --disable-gui was given
|
// icon when --disable-gui was given
|
||||||
|
@ -358,7 +358,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
Repositories.Add (repo);
|
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
|
// Updates the list of repositories with all the
|
||||||
// folders in the SparkleShare folder
|
// folders in the SparkleShare folder
|
||||||
public void UpdateRepositories ()
|
public void PopulateRepositories ()
|
||||||
{
|
{
|
||||||
|
|
||||||
Repositories = new List <SparkleRepo> ();
|
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);
|
AddRepository (folder_path);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the list in the statusicon
|
|
||||||
if (NotificationIcon != null)
|
|
||||||
NotificationIcon.CreateMenu ();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue