mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
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:
parent
1951eec009
commit
bb55232e8e
4 changed files with 15 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue