New Discovery Phase: fix a few FIXME
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 6 Aug 2018 09:27:11 +0000 (11:27 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:02 +0000 (10:58 +0100)
Some FIXME were already fixed.

src/libsync/discovery.cpp
src/libsync/discoveryphase.cpp
src/libsync/syncengine.cpp

index 458e3d73d9482999eebb3e567ce1569eabbf6342..13caaa977bd78d717302a97c0afdc860c03680de 100644 (file)
@@ -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;
         }
index e864233139b66373cbdea888f8d07f468e754183..6d58829ffb54805e2a9d2c65a0022f60aa924c95 100644 (file)
@@ -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;
 }
 
index 846374ef98ae757fa89e323e530d0feaf75e858a..58383630ac1e4752b9164f1a8f534862e4f4dd34 100644 (file)
@@ -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