continue;
}
- /* if the filename starts with a . we consider it a hidden file
- * For windows, the hidden state is also discovered within the vio
- * local stat function.
- */
- if( filename[0] == '.' ) {
- if (filename != ".sys.admin#recall#") { /* recall file shall not be ignored (#4420) */
- dirent->is_hidden = true;
- }
- }
#if 0
// Now process to have a relative path to the sync root for the local replica, or to the data root on the remote.
i.size = dirent->size;
i.inode = dirent->inode;
i.isDirectory = dirent->type == ItemTypeDirectory;
+ i.isHidden = dirent->is_hidden;
if (dirent->type != ItemTypeDirectory && dirent->type != ItemTypeFile)
qFatal("FIXME: NEED TO CARE ABOUT THE OTHER STUFF ");
_localEntries.push_back(i);
for (const auto &f : entriesNames) {
QString path = _currentFolder + f;
- if (handleExcluded(path, (localEntriesHash.value(f).isDirectory || serverEntriesHash.value(f).isDirectory)))
+ auto localEntry = localEntriesHash.value(f);
+ auto serverEntry = serverEntriesHash.value(f);
+
+ // If the filename starts with a . we consider it a hidden file
+ // For windows, the hidden state is also discovered within the vio
+ // local stat function.
+ // Recall file shall not be ignored (#4420)
+ bool isHidden = localEntry.isHidden || (f[0] == '.' && f != QLatin1String(".sys.admin#recall#"));
+ if (handleExcluded(path, localEntry.isDirectory || serverEntry.isDirectory, isHidden))
continue;
SyncJournalFileRecord record;
qFatal("TODO: DB ERROR HANDLING");
}
if (_queryServer == InBlackList || _discoveryData->isInSelectiveSyncBlackList(path)) {
- processBlacklisted(path, localEntriesHash.value(f), record);
+ processBlacklisted(path, localEntry, record);
continue;
}
- processFile(path, localEntriesHash.value(f), serverEntriesHash.value(f), record);
+ processFile(path, localEntry, serverEntry, record);
}
progress();
}
-bool ProcessDirectoryJob::handleExcluded(const QString &path, bool isDirectory)
+bool ProcessDirectoryJob::handleExcluded(const QString &path, bool isDirectory, bool isHidden)
{
// FIXME! call directly, without char* conversion
auto excluded = _discoveryData->_excludes->csyncTraversalMatchFun()(path.toUtf8(), isDirectory ? ItemTypeDirectory : ItemTypeFile);
isInvalidPattern = true;
}
}
+ if (excluded == CSYNC_NOT_EXCLUDED && _discoveryData->_ignoreHiddenFiles && isHidden) {
+ excluded = CSYNC_FILE_EXCLUDE_HIDDEN;
+ }
if (excluded == CSYNC_NOT_EXCLUDED /* FIXME && item->_type != ItemTypeSoftLink */) {
return false;
int64_t size = 0;
uint64_t inode = 0;
bool isDirectory = false;
+ bool isHidden = false;
bool isValid() const { return !name.isNull(); }
};
private:
void process();
// return true if the file is excluded
- bool handleExcluded(const QString &path, bool isDirectory);
+ bool handleExcluded(const QString &path, bool isDirectory, bool isHidden);
void processFile(const QString &, const LocalInfo &, const RemoteInfo &, const SyncJournalFileRecord &);
void processBlacklisted(const QString &path, const LocalInfo &, const SyncJournalFileRecord &);
void subJobFinished();
invalidFilenamePattern = "[\\\\:?*\"<>|]";
}
ddata->_invalidFilenamePattern = invalidFilenamePattern;
+ ddata->_ignoreHiddenFiles = ignoreHiddenFiles();
connect(ddata.data(), &DiscoveryPhase::folderDiscovered, this, &SyncEngine::slotFolderDiscovered);
connect(ddata.data(), &DiscoveryPhase::newBigFolder, this, &SyncEngine::newBigFolder);