mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Overlays: In case of folders, make sure to append slashes at end.
This fixes #2373
This commit is contained in:
parent
7cc6c1a10f
commit
c6daa8e59b
@ -580,6 +580,9 @@ bool Folder::estimateState(QString fn, csync_ftw_type_e t, SyncFileStatus* s)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(!fn.endsWith(QLatin1Char('/'))) {
|
||||
fn.append(QLatin1Char('/'));
|
||||
}
|
||||
if (Utility::doesSetContainPrefix(_stateTaintedFolders, fn)) {
|
||||
qDebug() << Q_FUNC_INFO << "Folder is tainted, EVAL!" << fn;
|
||||
s->set(SyncFileStatus::STATUS_EVAL);
|
||||
@ -616,6 +619,9 @@ void Folder::watcherSlot(QString fn)
|
||||
}
|
||||
// Make it a relative path depending on the folder
|
||||
QString relativePath = fn.remove(0, path().length());
|
||||
if( !relativePath.endsWith(QLatin1Char('/'))) {
|
||||
relativePath.append(QLatin1Char('/'));
|
||||
}
|
||||
qDebug() << Q_FUNC_INFO << fi.canonicalFilePath() << fn << relativePath;
|
||||
_stateTaintedFolders.insert(relativePath);
|
||||
|
||||
|
||||
@ -1101,9 +1101,16 @@ void SyncEngine::setSelectiveSyncBlackList(const QStringList& list)
|
||||
bool SyncEngine::estimateState(QString fn, csync_ftw_type_e t, SyncFileStatus* s)
|
||||
{
|
||||
Q_UNUSED(t);
|
||||
QString pat(fn);
|
||||
if( t == CSYNC_FTW_TYPE_DIR && ! fn.endsWith(QLatin1Char('/'))) {
|
||||
pat.append(QLatin1Char('/'));
|
||||
}
|
||||
|
||||
Q_FOREACH(const SyncFileItem &item, _syncedItems) {
|
||||
//qDebug() << Q_FUNC_INFO << fn << item._file << fn.startsWith(item._file) << item._file.startsWith(fn);
|
||||
if (item._file.startsWith(fn)) {
|
||||
|
||||
if (item._file.startsWith(pat) ||
|
||||
item._file == fn /* the same directory or file */) {
|
||||
qDebug() << Q_FUNC_INFO << "Setting" << fn << " to STATUS_EVAL";
|
||||
s->set(SyncFileStatus::STATUS_EVAL);
|
||||
return true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user