[Pkg-owncloud-commits] [owncloud-client] 367/470: Checksums: remove the downloadChecksumValidationEnabled option
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:25:27 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit fa69d089cfd4914dd46e19901c6899c719ead086
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Thu Apr 21 11:43:44 2016 +0200
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
---
src/libsync/checksums.cpp | 7 -------
src/libsync/checksums.h | 3 ---
src/libsync/configfile.cpp | 12 ------------
src/libsync/configfile.h | 8 --------
src/libsync/propagatedownload.cpp | 3 ---
5 files changed, 33 deletions(-)
diff --git a/src/libsync/checksums.cpp b/src/libsync/checksums.cpp
index 3a17825..af86149 100644
--- a/src/libsync/checksums.cpp
+++ b/src/libsync/checksums.cpp
@@ -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");
diff --git a/src/libsync/checksums.h b/src/libsync/checksums.h
index 670e3c0..eb2bd27 100644
--- a/src/libsync/checksums.h
+++ b/src/libsync/checksums.h
@@ -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();
diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp
index 931349a..acf3d6a 100644
--- a/src/libsync/configfile.cpp
+++ b/src/libsync/configfile.cpp
@@ -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);
diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h
index 361a82b..cd95f1a 100644
--- a/src/libsync/configfile.h
+++ b/src/libsync/configfile.h
@@ -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);
diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp
index 41170b6..1a9d299 100644
--- a/src/libsync/propagatedownload.cpp
+++ b/src/libsync/propagatedownload.cpp
@@ -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);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list