Utility: remove Utility::dataLocation

It is used only from one location, so put the code there
This commit is contained in:
Olivier Goffart 2014-07-07 15:26:49 +02:00
parent 7dd926d4f1
commit 517ffbd783
3 changed files with 6 additions and 13 deletions

View file

@ -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('/'));

View file

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

View file

@ -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);