From: Olivier Goffart Date: Thu, 28 Feb 2019 13:33:37 +0000 (+0100) Subject: Download: Remove useless code and add a test X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~602 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4eb899751995f9f2529042afa3ece0c66c5b10b2;p=nextcloud-desktop.git Download: Remove useless code and add a test From issue #7015, the code is wrong because the path is the file system path and not the path on the DB. But since this is a conflict, this means the reconcile will still want to download the file from the server next sync, so we need not to worry about this case --- diff --git a/src/libsync/owncloudpropagator.h b/src/libsync/owncloudpropagator.h index 4b34913e5..39419cd5b 100644 --- a/src/libsync/owncloudpropagator.h +++ b/src/libsync/owncloudpropagator.h @@ -354,7 +354,7 @@ public: } }; -class OwncloudPropagator : public QObject +class OWNCLOUDSYNC_EXPORT OwncloudPropagator : public QObject { Q_OBJECT public: diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 9504ea6f0..a14af832d 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -939,19 +939,6 @@ void PropagateDownloadFile::downloadFinished() // The fileChanged() check is done above to generate better error messages. if (!FileSystem::uncheckedRenameReplace(_tmpFile.fileName(), fn, &error)) { qCWarning(lcPropagateDownload) << QString("Rename failed: %1 => %2").arg(_tmpFile.fileName()).arg(fn); - - // If we moved away the original file due to a conflict but can't - // put the downloaded file in its place, we are in a bad spot: - // If we do nothing the next sync run will assume the user deleted - // the file! - // To avoid that, the file is removed from the metadata table entirely - // which makes it look like we're just about to initially download - // it. - if (isConflict) { - propagator()->_journal->deleteFileRecord(fn); - propagator()->_journal->commit("download finished"); - } - // If the file is locked, we want to retry this sync when it // becomes available again, otherwise try again directly if (FileSystem::isFileLocked(fn)) { diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index 89d018b6d..df9138e0d 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -126,6 +126,8 @@ public: /** Access the last sync run's local discovery style */ LocalDiscoveryStyle lastLocalDiscoveryStyle() const { return _lastLocalDiscoveryStyle; } + auto getPropagator() { return _propagator; } // for the test + signals: void csyncUnavailable();