} else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
file_stat->type = ItemTypeDirectory;
} else {
- // exclude ".lnk" files as they are not essential, but, causing troubles when enabling the VFS due to QFileInfo::isDir() and other methods are freezing, which causes the ".lnk" files to start hydrating and freezing the app eventually.
- file_stat->type = !OCC::FileSystem::isLnkFile(path) ? ItemTypeFile : ItemTypeSoftLink;
+ file_stat->type = ItemTypeFile;
}
/* Check for the hidden flag */
}
}
-#ifdef Q_OS_WIN
- // exclude ".lnk" files as they are not essential, but, causing troubles when enabling the VFS due to
- // QFileInfo::isDir() and other methods are freezing, which causes the ".lnk" files to start hydrating and freezing
- // the app eventually.
- const bool isServerEntryWindowsShortcut = !entries.localEntry.isValid() && entries.serverEntry.isValid()
- && !entries.serverEntry.isDirectory && FileSystem::isLnkFile(entries.serverEntry.name);
-#else
- const bool isServerEntryWindowsShortcut = false;
-#endif
- const auto isSymlink = entries.localEntry.isSymLink || isServerEntryWindowsShortcut;
-
- if (excluded == CSYNC_NOT_EXCLUDED && !isSymlink) {
+ if (excluded == CSYNC_NOT_EXCLUDED && !entries.localEntry.isSymLink) {
return false;
} else if (excluded == CSYNC_FILE_SILENTLY_EXCLUDED || excluded == CSYNC_FILE_EXCLUDE_AND_REMOVE) {
emit _discoveryData->silentlyExcluded(path);
item->_originalFile = path;
item->_instruction = CSYNC_INSTRUCTION_IGNORE;
- if (isSymlink) {
+ if (entries.localEntry.isSymLink) {
/* Symbolic links are ignored. */
item->_errorString = tr("Symbolic links are not supported in syncing.");
} else {
if (!localEntry.isValid()
&& item->_type == ItemTypeFile
&& opts._vfs->mode() != Vfs::Off
+ && !FileSystem::isLnkFile(item->_file)
&& _pinState != PinState::AlwaysLocal
&& !FileSystem::isExcludeFile(item->_file)) {
item->_type = ItemTypeVirtualFile;
Result<Vfs::ConvertToPlaceholderResult, QString> VfsCfApi::convertToPlaceholder(const QString &filename, const SyncFileItem &item, const QString &replacesFile)
{
+ if (item._type != ItemTypeDirectory && OCC::FileSystem::isLnkFile(filename)) {
+ qCInfo(lcCfApi) << "File \"" << filename << "\" is a Windows shortcut. Not converting it to a placeholder.";
+ return Vfs::ConvertToPlaceholderResult::Ok;
+ }
+
const auto localPath = QDir::toNativeSeparators(filename);
const auto replacesPath = QDir::toNativeSeparators(replacesFile);