CtrlLib: FileSel minor fix of network caching

git-svn-id: svn://ultimatepp.org/upp/trunk@15499 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-11-23 09:52:06 +00:00
parent f1081d09cd
commit 64c04306f1
2 changed files with 6 additions and 6 deletions

View file

@ -804,7 +804,7 @@ void FileSel::SelectNet()
}
#ifdef PLATFORM_WIN32
void FileSel::ScanNetwork(Function<Array<NetNode> ()> fn)
bool FileSel::ScanNetwork(Function<Array<NetNode> ()> fn)
{
Progress pi(t_("Scanning network.."));
loading_network = true;
@ -821,14 +821,14 @@ void FileSel::ScanNetwork(Function<Array<NetNode> ()> fn)
break;
if(pi.StepCanceled()) {
SetDir("");
return;
return false;
}
Sleep(10);
}
for(;;) {
if(pi.StepCanceled()) {
SetDir("");
return;
return false;
}
if(!loading_network) {
LoadNet();
@ -836,6 +836,7 @@ void FileSel::ScanNetwork(Function<Array<NetNode> ()> fn)
}
Sleep(10);
}
return true;
}
bool FileSel::netroot_loaded;
@ -848,14 +849,13 @@ void FileSel::ScanNetworkRoot()
LoadNet();
return;
}
ScanNetwork([] {
netroot_loaded = ScanNetwork([] {
Array<NetNode> n;
n = NetNode::EnumRoot();
n.Append(NetNode::EnumRemembered());
return n;
});
netroot = clone(netnode);
netroot_loaded = true;
}
#endif

View file

@ -279,7 +279,7 @@ protected:
void AddPlaceRaw(const String& path, const Image& m, const String& name, const char* group = NULL, int row = -1);
void AddSystemPlaces(int row = -1);
#ifdef PLATFORM_WIN32
void ScanNetwork(Function<Array<NetNode> ()> fn);
bool ScanNetwork(Function<Array<NetNode> ()> fn);
void ScanNetworkRoot();
#endif