@@ -228,9 +228,6 @@ void ProcessDirectoryJob::process()
228
228
checkAndUpdateSelectiveSyncListsForE2eeFolders (path._server + " /" );
229
229
}
230
230
231
- if (_discoveryData->_syncOptions ._vfs ->mode () == Vfs::WindowsCfApi && e.serverEntry .isDirectory && !e.localEntry .isValid () && !e.dbEntry .isValid ()) {
232
- checkAndAddSelectiveSyncListsForVfsOnDemandFolders (path._server + " /" );
233
- }
234
231
const auto isBlacklisted = _queryServer == InBlackList || _discoveryData->isInSelectiveSyncBlackList (path._original ) || isEncryptedFolderButE2eIsNotSetup;
235
232
236
233
const auto willBeExcluded = handleExcluded (path._target , e, entries, isHidden, isBlacklisted);
@@ -554,16 +551,6 @@ void ProcessDirectoryJob::checkAndUpdateSelectiveSyncListsForE2eeFolders(const Q
554
551
_discoveryData->_statedb ->setSelectiveSyncList (SyncJournalDb::SelectiveSyncE2eFoldersToRemoveFromBlacklist, toRemoveFromBlacklist);
555
552
}
556
553
557
- void ProcessDirectoryJob::checkAndAddSelectiveSyncListsForVfsOnDemandFolders (const QString &path)
558
- {
559
- _discoveryData->_selectiveSyncVfsFoldersList = _discoveryData->_statedb ->addSelectiveSyncLists (SyncJournalDb::SelectiveSyncVfsFoldersOnDemandList, path);
560
- }
561
-
562
- void ProcessDirectoryJob::removeSelectiveSyncListsForVfsOnDemandFolders (const QString &path)
563
- {
564
- _discoveryData->_selectiveSyncVfsFoldersList = _discoveryData->_statedb ->removeSelectiveSyncLists (SyncJournalDb::SelectiveSyncVfsFoldersOnDemandList, path);
565
- }
566
-
567
554
void ProcessDirectoryJob::processFile (PathTuple path,
568
555
const LocalInfo &localEntry, const RemoteInfo &serverEntry,
569
556
const SyncJournalFileRecord &dbEntry)
@@ -681,7 +668,17 @@ void ProcessDirectoryJob::postProcessServerNew(const SyncFileItemPtr &item,
681
668
const RemoteInfo &serverEntry,
682
669
const SyncJournalFileRecord &dbEntry)
683
670
{
671
+ const auto opts = _discoveryData->_syncOptions ;
672
+
684
673
if (item->isDirectory ()) {
674
+ // Turn new remote folders into virtual folders if the option is enabled.
675
+ if (!localEntry.isValid () &&
676
+ opts._vfs ->mode () != Vfs::Off &&
677
+ _pinState != PinState::AlwaysLocal &&
678
+ !FileSystem::isExcludeFile (item->_file )) {
679
+ item->_type = ItemTypeVirtualDirectory;
680
+ }
681
+
685
682
_pendingAsyncJobs++;
686
683
_discoveryData->checkSelectiveSyncNewFolder (path._server ,
687
684
serverEntry.remotePerm ,
@@ -696,14 +693,14 @@ void ProcessDirectoryJob::postProcessServerNew(const SyncFileItemPtr &item,
696
693
}
697
694
698
695
// Turn new remote files into virtual files if the option is enabled.
699
- const auto opts = _discoveryData->_syncOptions ;
700
696
if (!localEntry.isValid () &&
701
- item->_type == ItemTypeFile &&
702
697
opts._vfs ->mode () != Vfs::Off &&
703
698
_pinState != PinState::AlwaysLocal &&
704
699
!FileSystem::isExcludeFile (item->_file )) {
705
700
706
- item->_type = ItemTypeVirtualFile;
701
+ if (item->_type == ItemTypeFile) {
702
+ item->_type = ItemTypeVirtualFile;
703
+ }
707
704
if (isVfsWithSuffix ()) {
708
705
addVirtualFileSuffix (path._original );
709
706
}
@@ -1135,7 +1132,8 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
1135
1132
const auto isTypeChange = item->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE;
1136
1133
1137
1134
qCDebug (lcDisco) << " File" << item->_file << " - servermodified:" << serverModified
1138
- << " noServerEntry:" << noServerEntry;
1135
+ << " noServerEntry:" << noServerEntry
1136
+ << " type:" << item->_type ;
1139
1137
1140
1138
if (serverEntry.isValid ()) {
1141
1139
item->_folderQuota .bytesUsed = serverEntry.folderQuota .bytesUsed ;
@@ -1433,7 +1431,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
1433
1431
item->_checksumHeader .clear ();
1434
1432
item->_size = localEntry.size ;
1435
1433
item->_modtime = localEntry.modtime ;
1436
- item->_type = localEntry.isDirectory ? ItemTypeDirectory : localEntry.isVirtualFile ? ItemTypeVirtualFile : ItemTypeFile;
1434
+ item->_type = localEntry.isDirectory && !localEntry. isVirtualFile ? ItemTypeDirectory : localEntry. isDirectory ? ItemTypeVirtualDirectory : localEntry.isVirtualFile ? ItemTypeVirtualFile : ItemTypeFile;
1437
1435
_childModified = true ;
1438
1436
1439
1437
if (!localEntry.caseClashConflictingName .isEmpty ()) {
@@ -1888,7 +1886,7 @@ void ProcessDirectoryJob::processFileFinalize(
1888
1886
Q_ASSERT (false );
1889
1887
}
1890
1888
1891
- if (recurse && _discoveryData-> shouldDiscoverChildFolder (path. _server ) ) {
1889
+ if (recurse && item-> _type == ItemTypeDirectory ) {
1892
1890
auto job = new ProcessDirectoryJob (path, item, recurseQueryLocal, recurseQueryServer,
1893
1891
_lastSyncTimestamp, this );
1894
1892
job->setInsideEncryptedTree (isInsideEncryptedTree () || item->isEncrypted ());
0 commit comments