#include "discovery.h"
#include "common/syncjournaldb.h"
+#ifdef Q_OS_WIN
+#include "common/filesystembase.h"
+#endif
#include "syncfileitem.h"
#include <QDebug>
#include <algorithm>
});
return;
}
-#ifdef Q_OS_WIN
- const bool forceAlwaysLocal = item->_type == ItemTypeFile && item->_fileId.endsWith(".lnk");
-#else
- const bool forceAlwaysLocal = false;
-#endif
- if (forceAlwaysLocal) {
- int a = 5;
- a = 6;
- }
// Turn new remote files into virtual files if the option is enabled.
auto &opts = _discoveryData->_syncOptions;
if (!localEntry.isValid()
&& item->_type == ItemTypeFile
&& opts._vfs->mode() != Vfs::Off
&& _pinState != PinState::AlwaysLocal
- && !forceAlwaysLocal) {
+#ifdef Q_OS_WIN
+ && !FileSystem::isLnkFile(path._server)
+#endif
+ ) {
item->_type = ItemTypeVirtualFile;
if (isVfsWithSuffix())
addVirtualFileSuffix(tmp_path._original);
rec._serverHasIgnoredFiles |= prev._serverHasIgnoredFiles;
// Ensure it's a placeholder file on disk
- if (item->_type == ItemTypeFile) {
+ if (item->_type == ItemTypeFile
+#ifdef Q_OS_WIN
+ && !FileSystem::isLnkFile(filePath)
+#endif
+ ) {
const auto result = _syncOptions._vfs->convertToPlaceholder(filePath, *item);
if (!result) {
item->_instruction = CSYNC_INSTRUCTION_ERROR;