From dec3bd4a0206156ff1db040cc2a0df787d80b111 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Wed, 20 May 2015 22:44:12 +0200 Subject: [PATCH] Some more minor cleanups based on the pull request review. --- src/libsync/owncloudpropagator.cpp | 2 +- src/libsync/propagatedownload.cpp | 6 +++--- src/libsync/propagatedownload.h | 1 - src/libsync/propagateupload.cpp | 7 ++----- src/libsync/propagatorjobs.h | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index c7826888d7..ff9beaa1e7 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -270,7 +270,7 @@ void OwncloudPropagator::start(const SyncFileItemVector& items) checksumType == checkSumSHA1C ) { qDebug() << "Client sends and expects transmission checksum type" << checksumType; } else { - qDebug() << "WARN: Unknown transmission checksum type from config" << checksumType; + qWarning() << "Unknown transmission checksum type from config" << checksumType; } } diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index aa30a3ac57..76fa59c39d 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -486,9 +486,9 @@ void PropagateDownloadFileQNAM::slotGetFinished() return; } - // do whatever is needed to add a checksum to the http upload request. - // in any case, the validator will emit signal startUpload to let the flow - // continue in slotStartUpload here. + // Do checksum validation for the download. If there is no checksum header, the validator + // will also emit the validated() signal to continue the flow in slot downloadFinished() + // as this is (still) also correct. TransmissionChecksumValidator *validator = new TransmissionChecksumValidator(_tmpFile.fileName(), this); connect(validator, SIGNAL(validated()), this, SLOT(downloadFinished())); connect(validator, SIGNAL(validationFailed(QString)), this, SLOT(slotChecksumFail(QString))); diff --git a/src/libsync/propagatedownload.h b/src/libsync/propagatedownload.h index b2cf18c262..68a059ffb1 100644 --- a/src/libsync/propagatedownload.h +++ b/src/libsync/propagatedownload.h @@ -114,7 +114,6 @@ private slots: void slotChecksumFail( const QString& errMsg ); private: - // Utility::StopWatch _stopWatch; QPointer _job; QFile _tmpFile; }; diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp index f602132a85..dfbba205ef 100644 --- a/src/libsync/propagateupload.cpp +++ b/src/libsync/propagateupload.cpp @@ -23,7 +23,6 @@ #include "filesystem.h" #include "propagatorjobs.h" #include "transmissionchecksumvalidator.h" -#include "configfile.h" #include #include @@ -226,16 +225,14 @@ void PropagateUploadFileQNAM::slotStartUpload() } _stopWatch.addLapTime(QLatin1String("Checksum")); - // Update the mtime and size, it might have changed since discovery. - time_t prevModtime = _item._modtime; // the value was set in PropagateUploadFileQNAM::start() + time_t prevModtime = _item._modtime; // the _item value was set in PropagateUploadFileQNAM::start() // but a potential checksum calculation could have taken some time during which the file could // have been changed again, so better check again here. - // Update the mtime and size, it might have changed since discovery. _item._modtime = FileSystem::getModTime(fullFilePath); if( prevModtime != _item._modtime ) { _propagator->_anotherSyncNeeded = true; - done(SyncFileItem::SoftError, tr("Local file changed while calculating the checksum.")); + done(SyncFileItem::SoftError, tr("Local file changed during syncing. It will be resumed.")); return; } diff --git a/src/libsync/propagatorjobs.h b/src/libsync/propagatorjobs.h index 463cb07b62..d1b31d74e3 100644 --- a/src/libsync/propagatorjobs.h +++ b/src/libsync/propagatorjobs.h @@ -35,7 +35,7 @@ static const char checkSumAdlerC[] = "Adler32"; static const char checkSumAdlerUpperC[] = "ADLER32"; /** - * Declaration of the other propation jobs + * Declaration of the other propagation jobs */ class PropagateLocalRemove : public PropagateItemJob { Q_OBJECT