Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex-z <blackslayer4@gmail.com>2022-09-20 12:47:18 +0300
committeralex-z <blackslayer4@gmail.com>2022-09-21 18:04:53 +0300
commit466a9e2c412c9f04d7eb510326c416f804036829 (patch)
tree1a57ffa7ddbb8ca8e52a34a7e3e6c68162a8a159
parent70a6588e45a3b0a951cf311d9ee1cde64f890af4 (diff)
Do not treat .lnk files as VFS placeholders on Windows.bugfix/experiment-with-qfileinfo-wrapper-windows
Signed-off-by: alex-z <blackslayer4@gmail.com>
-rw-r--r--src/csync/vio/csync_vio_local_win.cpp3
-rw-r--r--src/libsync/discovery.cpp12
-rw-r--r--src/libsync/vfs/cfapi/vfs_cfapi.cpp5
3 files changed, 8 insertions, 12 deletions
diff --git a/src/csync/vio/csync_vio_local_win.cpp b/src/csync/vio/csync_vio_local_win.cpp
index 4ddd4f545..dfb33742c 100644
--- a/src/csync/vio/csync_vio_local_win.cpp
+++ b/src/csync/vio/csync_vio_local_win.cpp
@@ -162,8 +162,7 @@ std::unique_ptr<csync_file_stat_t> csync_vio_local_readdir(csync_vio_handle_t *h
} 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 */
diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp
index 7a59f1fa9..530191e27 100644
--- a/src/libsync/discovery.cpp
+++ b/src/libsync/discovery.cpp
@@ -254,16 +254,7 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent
}
}
-#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;
+ const auto isSymlink = entries.localEntry.isSymLink;
if (excluded == CSYNC_NOT_EXCLUDED && !isSymlink) {
return false;
@@ -640,6 +631,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
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;
diff --git a/src/libsync/vfs/cfapi/vfs_cfapi.cpp b/src/libsync/vfs/cfapi/vfs_cfapi.cpp
index d201e36c4..69ca5417d 100644
--- a/src/libsync/vfs/cfapi/vfs_cfapi.cpp
+++ b/src/libsync/vfs/cfapi/vfs_cfapi.cpp
@@ -211,6 +211,11 @@ Result<void, QString> VfsCfApi::dehydratePlaceholder(const SyncFileItem &item)
Result<Vfs::ConvertToPlaceholderResult, QString> VfsCfApi::convertToPlaceholder(const QString &filename, const SyncFileItem &item, const QString &replacesFile)
{
+ if (item._type == ItemTypeFile && 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);