Some more minor cleanups based on the pull request review.

This commit is contained in:
Klaas Freitag 2015-05-20 22:44:12 +02:00
parent 64ce0cd7a2
commit dec3bd4a02
5 changed files with 7 additions and 11 deletions

View file

@ -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;
}
}

View file

@ -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)));

View file

@ -114,7 +114,6 @@ private slots:
void slotChecksumFail( const QString& errMsg );
private:
// Utility::StopWatch _stopWatch;
QPointer<GETFileJob> _job;
QFile _tmpFile;
};

View file

@ -23,7 +23,6 @@
#include "filesystem.h"
#include "propagatorjobs.h"
#include "transmissionchecksumvalidator.h"
#include "configfile.h"
#include <json.h>
#include <QNetworkAccessManager>
@ -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;
}

View file

@ -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