[Pkg-owncloud-commits] [owncloud-client] 86/175: Theme: Allow to change the transmission checksum through theming.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Aug 8 10:36:30 UTC 2015


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 d2fff2c3e32d702b2f3b2bb6d6f33f871058d25c
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue Apr 21 11:16:45 2015 +0200

    Theme: Allow to change the transmission checksum through theming.
---
 src/libsync/configfile.cpp | 10 +++++++++-
 src/libsync/theme.cpp      |  5 +++++
 src/libsync/theme.h        |  9 ++++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp
index 62701af..2b04b11 100644
--- a/src/libsync/configfile.cpp
+++ b/src/libsync/configfile.cpp
@@ -122,7 +122,15 @@ int ConfigFile::timeout() const
 QString ConfigFile::transmissionChecksum() const
 {
     QSettings settings(configFile(), QSettings::IniFormat);
-    return settings.value(QLatin1String(transmissionChecksumC), QString()).toString();
+
+    QString checksum = settings.value(QLatin1String(transmissionChecksumC), QString()).toString();
+
+    if( checksum.isEmpty() ) {
+        // if the config file setting is empty, maybe the Branding requires it.
+        checksum = Theme::instance()->transmissionChecksum();
+    }
+
+    return checksum;
 }
 
 void ConfigFile::setOptionalDesktopNotifications(bool show)
diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp
index d37975c..a388f3c 100644
--- a/src/libsync/theme.cpp
+++ b/src/libsync/theme.cpp
@@ -241,6 +241,11 @@ QString Theme::updateCheckUrl() const
     return QLatin1String("https://updates.owncloud.com/client/");
 }
 
+QString Theme::transmissionChecksum() const
+{
+    return QString::null; // No transmission by default.
+}
+
 QString Theme::gitSHA1() const
 {
     QString devString;
diff --git a/src/libsync/theme.h b/src/libsync/theme.h
index 975e234..7f30950 100644
--- a/src/libsync/theme.h
+++ b/src/libsync/theme.h
@@ -189,12 +189,19 @@ public:
      */
     virtual QString updateCheckUrl() const;
 
-
     /**
      * When true, the setup wizard will show the selective sync dialog by default and default
      * to nothing selected
      */
     virtual bool wizardSelectiveSyncDefaultNothing() const;
+    /**
+     * @brief Add an additional checksum header to PUT requests and compare them
+     * if they come with GET requests.
+     * This value sets the checksum type (SHA1, MD5 or Adler32) or is left empty
+     * if no checksumming is wanted. In that case it can still be overwritten in
+     * the client config file.
+     */
+    virtual QString transmissionChecksum() const;
 
 protected:
 #ifndef TOKEN_AUTH_ONLY

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