CLOUD: Ignore hidden files in sync/download

In PR#1754 we've discussed and decided to ignore hidden (having a name
starting with '.') files while syncing saves or downloading game files.
This commit adds a CloudManager method to test whether file should be
ignored, and this method could be extended later if we need to ignore
some other specific file names.
This commit is contained in:
Alexander Tkachev 2019-07-24 19:12:14 +07:00 committed by Matan Bareket
parent 7fc6477ce2
commit e7ca2b8db0
4 changed files with 15 additions and 3 deletions

View file

@ -26,6 +26,7 @@
#include "common/debug.h"
#include "gui/downloaddialog.h"
#include <backends/networking/curl/connectionmanager.h>
#include "cloudmanager.h"
namespace Cloud {
@ -73,8 +74,9 @@ void FolderDownloadRequest::directoryListedCallback(Storage::ListDirectoryRespon
// remove all directories
// non-empty directories would be created by DumpFile, and empty ones are just ignored
// also skip all hidden files (with names starting with '.') or with other names that are forbidden to sync in CloudManager
for (Common::Array<StorageFile>::iterator i = _pendingFiles.begin(); i != _pendingFiles.end();)
if (i->isDirectory())
if (i->isDirectory() || !CloudMan.canSyncFilename(i->name()))
_pendingFiles.erase(i);
else {
_totalBytes += i->size();