[Pkg-owncloud-commits] [owncloud-client] 175/332: Utility: remove Utility::dataLocation

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:56 UTC 2014


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 517ffbd78355ca1b2b895b4a4fe9bdad67c21039
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Jul 7 15:26:49 2014 +0200

    Utility: remove Utility::dataLocation
    
    It is used only from one location, so put the code there
---
 src/mirall/mirallconfigfile.cpp |  7 ++++++-
 src/mirall/utility.cpp          | 11 -----------
 src/mirall/utility.h            |  1 -
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/mirall/mirallconfigfile.cpp b/src/mirall/mirallconfigfile.cpp
index a547464..8988a05 100644
--- a/src/mirall/mirallconfigfile.cpp
+++ b/src/mirall/mirallconfigfile.cpp
@@ -25,6 +25,7 @@
 #ifndef TOKEN_AUTH_ONLY
 #include <QWidget>
 #include <QHeaderView>
+#include <QDesktopServices>
 #endif
 
 #include <QCoreApplication>
@@ -183,9 +184,13 @@ QVariant MirallConfigFile::getPolicySetting(const QString &setting, const QVaria
 
 QString MirallConfigFile::configPath() const
 {
+    #ifndef TOKEN_AUTH_ONLY
     if( _confDir.isEmpty() ) {
-        _confDir = Utility::dataLocation();
+        //  Qt 5's QStandardPaths::writableLocation gives us wrong results (without /data/),
+        //  so we'll have to use the deprecated version for now
+        _confDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
     }
+    #endif
     QString dir = _confDir;
 
     if( !dir.endsWith(QLatin1Char('/')) ) dir.append(QLatin1Char('/'));
diff --git a/src/mirall/utility.cpp b/src/mirall/utility.cpp
index 497376a..055abd7 100644
--- a/src/mirall/utility.cpp
+++ b/src/mirall/utility.cpp
@@ -237,17 +237,6 @@ QString Utility::escape(const QString &in)
 #endif
 }
 
-QString Utility::dataLocation()
-{
-    //  Qt 5's QStandardPaths::writableLocation gives us wrong results (without /data/),
-    //  so we'll have to use the deprecated version for now
-#ifndef TOKEN_AUTH_ONLY
-    return QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-#else
-	return QString();
-#endif
-}
-
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
 // In Qt 4,  QThread::sleep functions are protected.
 // This is a hack to make them visible in this namespace.
diff --git a/src/mirall/utility.h b/src/mirall/utility.h
index 0ff9ac9..864a5bf 100644
--- a/src/mirall/utility.h
+++ b/src/mirall/utility.h
@@ -55,7 +55,6 @@ namespace Utility
 
     // porting methods
     OWNCLOUDSYNC_EXPORT QString escape(const QString&);
-    OWNCLOUDSYNC_EXPORT QString dataLocation();
 
     // conversion function QDateTime <-> time_t   (because the ones builtin work on only unsigned 32bit)
     OWNCLOUDSYNC_EXPORT QDateTime qDateTimeFromTime_t(qint64 t);

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