Checksums: remove the downloadChecksumValidationEnabled option

Added in previous commit from pull request #4663

As discussed, we do not need this option so no need to introduce
a new dependency on the config file in the sync engine
This commit is contained in:
Olivier Goffart 2016-04-21 11:43:44 +02:00
parent ea40e314d4
commit fa69d089cf
5 changed files with 0 additions and 33 deletions

View file

@ -17,7 +17,6 @@
#include "syncfileitem.h"
#include "propagatorjobs.h"
#include "account.h"
#include "configfile.h"
#include <qtconcurrentrun.h>
@ -109,12 +108,6 @@ bool uploadChecksumEnabled()
return enabled;
}
bool downloadChecksumValidationEnabled()
{
static bool disabledByConfig = ConfigFile().disableDownloadChecksumValidation();
return !disabledByConfig;
}
QByteArray contentChecksumType()
{
static QByteArray type = qgetenv("OWNCLOUD_CONTENT_CHECKSUM_TYPE");

View file

@ -34,9 +34,6 @@ bool parseChecksumHeader(const QByteArray& header, QByteArray* type, QByteArray*
/// Checks OWNCLOUD_DISABLE_CHECKSUM_UPLOAD
bool uploadChecksumEnabled();
/// Checks disableDownloadChecksumValidation from the config file
bool downloadChecksumValidationEnabled();
/// Checks OWNCLOUD_CONTENT_CHECKSUM_TYPE (default: SHA1)
QByteArray contentChecksumType();

View file

@ -52,7 +52,6 @@ static const char updateCheckIntervalC[] = "updateCheckInterval";
static const char geometryC[] = "geometry";
static const char timeoutC[] = "timeout";
static const char chunkSizeC[] = "chunkSize";
static const char disableDownloadChecksumValidationC[] = "disableDownloadChecksumValidation";
static const char proxyHostC[] = "Proxy/host";
static const char proxyTypeC[] = "Proxy/type";
@ -129,17 +128,6 @@ quint64 ConfigFile::chunkSize() const
return settings.value(QLatin1String(chunkSizeC), 10*1000*1000).toLongLong(); // default to 10 MB
}
bool ConfigFile::disableDownloadChecksumValidation() const
{
QSettings settings(configFile(), QSettings::IniFormat);
QVariant value = settings.value(QLatin1String(disableDownloadChecksumValidationC));
if (!value.isValid()) {
return false;
}
return value.toBool();
}
void ConfigFile::setOptionalDesktopNotifications(bool show)
{
QSettings settings(configFile(), QSettings::IniFormat);

View file

@ -114,14 +114,6 @@ public:
int timeout() const;
quint64 chunkSize() const;
/** Whether to disable download checksum validation.
*
* By default (false) received checksums will be validated. This flag
* can disable checksum validation and is intended for debugging purposes
* only.
*/
bool disableDownloadChecksumValidation() const;
void saveGeometry(QWidget *w);
void restoreGeometry(QWidget *w);

View file

@ -555,9 +555,6 @@ void PropagateDownloadFileQNAM::slotGetFinished()
connect(validator, SIGNAL(validationFailed(QString)),
SLOT(slotChecksumFail(QString)));
auto checksumHeader = job->reply()->rawHeader(checkSumHeaderC);
if (!downloadChecksumValidationEnabled()) {
checksumHeader.clear();
}
validator->start(_tmpFile.fileName(), checksumHeader);
}