Fix review comments.
authorallexzander <blackslayer4@gmail.com>
Tue, 6 Apr 2021 07:36:35 +0000 (10:36 +0300)
committerallexzander (Rebase PR Action) <allexzander@users.noreply.github.com>
Wed, 7 Apr 2021 09:08:02 +0000 (09:08 +0000)
Signed-off-by: allexzander <blackslayer4@gmail.com>
src/csync/vio/csync_vio_local_win.cpp
src/libsync/discoveryphase.cpp

index cc31927d566d1a4faf748dc10d09095d867747fc..7aa07f4da4eacc60896973c7b9759d84eb669847 100644 (file)
@@ -163,7 +163,8 @@ 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 {
-        file_stat->type = ItemTypeFile;
+        // 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;
     }
 
     /* Check for the hidden flag */
index bce9276ad8bfdabcae9359578918d9409b8a404e..c8b522dcfcea626838eecf7deef3f44121aebc59 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "common/asserts.h"
 #include "common/checksums.h"
-#include "common/filesystembase.h"
 
 #include <csync_exclude.h>
 #include "vio/csync_vio_local.h"
@@ -306,13 +305,7 @@ void DiscoverySingleLocalDirectoryJob::run() {
         i.inode = dirent->inode;
         i.isDirectory = dirent->type == ItemTypeDirectory;
         i.isHidden = dirent->is_hidden;
-#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 isWindowsShortcut = dirent->type == ItemTypeFile && FileSystem::isLnkFile(i.name);
-#else
-        const bool isWindowsShortcut = false;
-#endif
-        i.isSymLink = dirent->type == ItemTypeSoftLink || isWindowsShortcut;
+        i.isSymLink = dirent->type == ItemTypeSoftLink;
         i.isVirtualFile = dirent->type == ItemTypeVirtualFile || dirent->type == ItemTypeVirtualFileDownload;
         i.type = dirent->type;
         results.push_back(i);