TerraSync: fix Windows behaviour
SGDir on Windows returns dot-files by default, which includes our hash-cache, causing it to be orphaned.
This commit is contained in:
parent
b7308fa3ad
commit
439fa4c4a1
@ -314,7 +314,15 @@ public:
|
|||||||
|
|
||||||
simgear::Dir d(absolutePath());
|
simgear::Dir d(absolutePath());
|
||||||
PathList fsChildren = d.children(0);
|
PathList fsChildren = d.children(0);
|
||||||
PathList orphans = d.children(0);
|
PathList orphans = fsChildren;
|
||||||
|
|
||||||
|
// on Windows, children() will return our .hashes and .dirIndex
|
||||||
|
// entries; skip them.
|
||||||
|
orphans.erase(std::remove_if(orphans.begin(), orphans.end(),
|
||||||
|
[](const SGPath &p) {
|
||||||
|
return p.file().front() == '.';
|
||||||
|
}),
|
||||||
|
orphans.end());
|
||||||
|
|
||||||
for (const auto &c : children) {
|
for (const auto &c : children) {
|
||||||
// Check if the file exists
|
// Check if the file exists
|
||||||
|
Loading…
Reference in New Issue
Block a user