diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp index d199b8117c..5ec06e2b14 100644 --- a/src/mirall/folder.cpp +++ b/src/mirall/folder.cpp @@ -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); diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp index d6cdb2fed6..c03ed124f0 100644 --- a/src/mirall/syncengine.cpp +++ b/src/mirall/syncengine.cpp @@ -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;