VFS freeze fix. Treat .sync-exclude.lst as a non-virtual file always.

Signed-off-by: allexzander <blackslayer4@gmail.com>
This commit is contained in:
allexzander 2021-05-31 18:30:20 +03:00 committed by Matthieu Gallien (Rebase PR Action)
parent 1951eec009
commit bb55232e8e
4 changed files with 15 additions and 2 deletions

View file

@ -480,6 +480,11 @@ bool FileSystem::isLnkFile(const QString &filename)
return filename.endsWith(QLatin1String(".lnk"));
}
bool FileSystem::isExcludeFile(const QString &filename)
{
return filename.endsWith(QLatin1String(".sync-exclude.lst"));
}
bool FileSystem::isJunction(const QString &filename)
{
#ifdef Q_OS_WIN

View file

@ -153,6 +153,11 @@ namespace FileSystem {
*/
bool OCSYNC_EXPORT isLnkFile(const QString &filename);
/**
* Returns whether the file is an exclude file (contains patterns to exclude from sync)
*/
bool OCSYNC_EXPORT isExcludeFile(const QString &filename);
/**
* Returns whether the file is a junction (windows only)
*/

View file

@ -521,7 +521,8 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
if (!localEntry.isValid()
&& item->_type == ItemTypeFile
&& opts._vfs->mode() != Vfs::Off
&& _pinState != PinState::AlwaysLocal) {
&& _pinState != PinState::AlwaysLocal
&& !FileSystem::isExcludeFile(item->_file)) {
item->_type = ItemTypeVirtualFile;
if (isVfsWithSuffix())
addVirtualFileSuffix(tmp_path._original);

View file

@ -187,6 +187,8 @@ bool VfsCfApi::statTypeVirtualFile(csync_file_stat_t *stat, void *statData)
const auto isWindowsShortcut = !isDirectory && FileSystem::isLnkFile(stat->path);
const auto isExcludeFile = !isDirectory && FileSystem::isExcludeFile(stat->path);
// It's a dir with a reparse point due to the placeholder info (hence the cloud tag)
// if we don't remove the reparse point flag the discovery will end up thinking
// it is a file... let's prevent it
@ -198,7 +200,7 @@ bool VfsCfApi::statTypeVirtualFile(csync_file_stat_t *stat, void *statData)
} else if (isSparseFile && isPinned) {
stat->type = ItemTypeVirtualFileDownload;
return true;
} else if (!isSparseFile && isUnpinned && !isWindowsShortcut){
} else if (!isSparseFile && isUnpinned && !isWindowsShortcut && !isExcludeFile) {
stat->type = ItemTypeVirtualFileDehydration;
return true;
} else if (isSparseFile) {