From: Olivier Goffart Date: Mon, 6 Aug 2018 09:27:11 +0000 (+0200) Subject: New Discovery Phase: fix a few FIXME X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~533 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b6487181c6b65236d451979c530c424ca6c568d8;p=nextcloud-desktop.git New Discovery Phase: fix a few FIXME Some FIXME were already fixed. --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 458e3d73d..13caaa977 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -195,7 +195,7 @@ void ProcessDirectoryJob::process() if (_queryServer == ParentNotChanged || _queryLocal == ParentNotChanged) { // fetch all the name from the DB auto pathU8 = _currentFolder._original.toUtf8(); - // FIXME cache, and do that better (a query that do not get stuff recursively) + // FIXME do that better (a query that do not get stuff recursively ?) if (!_discoveryData->_statedb->getFilesBelowPath(pathU8, [&](const SyncJournalFileRecord &rec) { if (rec._path.indexOf("/", pathU8.size() + 1) > 0) return; @@ -343,18 +343,8 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, bool isDirectory, case CSYNC_FILE_EXCLUDE_CONFLICT: item->_errorString = tr("Conflict: Server version downloaded, local copy renamed and not uploaded."); item->_status = SyncFileItem::Conflict; -#if 0 // TODO: port this - if (_propagator->account()->capabilities().uploadConflictFiles()) { - // For uploaded conflict files, files with no action performed on them should - // be displayed: but we mustn't overwrite the instruction if something happens - // to the file! - if (remote && item->_instruction == CSYNC_INSTRUCTION_NONE) { - item->_errorString = tr("Unresolved conflict."); - item->_instruction = CSYNC_INSTRUCTION_IGNORE; - } -#endif break; - case CSYNC_FILE_EXCLUDE_CANNOT_ENCODE: // FIXME! + case CSYNC_FILE_EXCLUDE_CANNOT_ENCODE: item->_errorString = tr("The filename cannot be encoded on your file system."); break; } diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index e86423313..6d58829ff 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -70,16 +70,6 @@ bool DiscoveryPhase::isInSelectiveSyncBlackList(const QString &path) const return true; } - /** FIXME - // Also try to adjust the path if there was renames - if (csync_rename_count(_csync_ctx)) { - QByteArray adjusted = csync_rename_adjust_parent_path_source(_csync_ctx, path); - if (adjusted != path) { - return findPathInList(_selectiveSyncBlackList, QString::fromUtf8(adjusted)); - } - } - */ - return false; } diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 846374ef9..58383630a 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -342,6 +342,14 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item) return; } else if (item->_instruction == CSYNC_INSTRUCTION_NONE) { _hasNoneFiles = true; + if (_account->capabilities().uploadConflictFiles() && Utility::isConflictFile(item->_file)) { + // For uploaded conflict files, files with no action performed on them should + // be displayed: but we mustn't overwrite the instruction if something happens + // to the file! + item->_errorString = tr("Unresolved conflict."); + item->_instruction = CSYNC_INSTRUCTION_IGNORE; + item->_status = SyncFileItem::Conflict; + } return; } else if (item->_instruction == CSYNC_INSTRUCTION_REMOVE) { _hasRemoveFile = true; @@ -721,9 +729,6 @@ void SyncEngine::slotDiscoveryJobFinished() // Sort items per destination std::sort(_syncItems.begin(), _syncItems.end()); - // make sure everything is allowed - // TODO checkForPermission(_syncItems); - _localDiscoveryPaths.clear(); // To announce the beginning of the sync