[controller] Prevent some crashes clicking logs byy only showing them once the list is done loading

This commit is contained in:
Hylke Bons 2011-03-25 10:24:46 +00:00
parent 0749c1a5ce
commit 2adedd88f9

View file

@ -137,11 +137,22 @@ namespace SparkleShare {
RemoveRepository (args.FullPath); RemoveRepository (args.FullPath);
if (FolderListChanged != null)
FolderListChanged ();
FolderSize = GetFolderSize ();
if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize);
}; };
// Add the repository when a create event occurs // Add the repository when a create event occurs
watcher.Created += delegate (object o, FileSystemEventArgs args) { watcher.Created += delegate (object o, FileSystemEventArgs args) {
// TODO: Needs to wait until the copying over is done
// Handle invitations when the user saves an // Handle invitations when the user saves an
// invitation into the SparkleShare folder // invitation into the SparkleShare folder
if (args.Name.EndsWith (".sparkle") && !FirstRun) { if (args.Name.EndsWith (".sparkle") && !FirstRun) {
@ -153,15 +164,22 @@ namespace SparkleShare {
string folder = xml_doc.GetElementsByTagName ("folder") [0].InnerText; string folder = xml_doc.GetElementsByTagName ("folder") [0].InnerText;
string token = xml_doc.GetElementsByTagName ("token") [0].InnerText; string token = xml_doc.GetElementsByTagName ("token") [0].InnerText;
// TODO: this is broken :\ // FIXME: this is broken :\
if (OnInvitation != null) if (OnInvitation != null)
OnInvitation (server, folder, token); OnInvitation (server, folder, token);
// FIXME: big repos seem to often fail because they don't pass this test
} else if (SparkleRepo.IsRepo (args.FullPath)) { } else if (SparkleRepo.IsRepo (args.FullPath)) {
AddRepository (args.FullPath); AddRepository (args.FullPath);
if (FolderListChanged != null)
FolderListChanged ();
FolderSize = GetFolderSize ();
if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize);
} }
}; };
@ -589,16 +607,6 @@ namespace SparkleShare {
Repositories.Add (repo); Repositories.Add (repo);
if (FolderListChanged != null)
FolderListChanged ();
FolderSize = GetFolderSize ();
if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize);
} }
@ -624,16 +632,6 @@ namespace SparkleShare {
} }
if (FolderListChanged != null)
FolderListChanged ();
FolderSize = GetFolderSize ();
if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize);
} }
@ -647,6 +645,15 @@ namespace SparkleShare {
foreach (string folder_path in Directory.GetDirectories (SparklePaths.SparklePath)) foreach (string folder_path in Directory.GetDirectories (SparklePaths.SparklePath))
AddRepository (folder_path); AddRepository (folder_path);
if (FolderListChanged != null)
FolderListChanged ();
FolderSize = GetFolderSize ();
if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize);
} }