[Pkg-owncloud-commits] [owncloud-client] 56/175: Branding: Append the appName short to the user agent string.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Aug 8 10:36:27 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 ec83295b99d67e28454ca303b922cd4514448793
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon May 4 17:42:31 2015 +0200

    Branding: Append the appName short to the user agent string.
---
 src/libsync/utility.cpp | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/libsync/utility.cpp b/src/libsync/utility.cpp
index 1fb1c3e..42da7d6 100644
--- a/src/libsync/utility.cpp
+++ b/src/libsync/utility.cpp
@@ -15,6 +15,7 @@
 #include "utility.h"
 
 #include "version.h"
+#include "theme.h"
 
 // Note:  This file must compile without QtGui
 #include <QCoreApplication>
@@ -154,10 +155,19 @@ QString Utility::platform()
 
 QByteArray Utility::userAgentString()
 {
-    return QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
+    QString re = QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
             .arg(Utility::platform())
-            .arg(QLatin1String(MIRALL_STRINGIFY(MIRALL_VERSION)))
-            .toLatin1();
+            .arg(QLatin1String(MIRALL_STRINGIFY(MIRALL_VERSION)));
+
+    const QString appName = Theme::instance()->appName();
+
+    // this constant "ownCloud" is defined in the default OEM theming
+    // that is used for the standard client. If it is changed there,
+    // it needs to be adjusted here.
+    if( appName != QLatin1String("ownCloud") ) {
+        re += QString(" (%1)").arg(appName);
+    }
+    return re.toLatin1();
 }
 
 bool Utility::hasLaunchOnStartup(const QString &appName)

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