diff --git a/src/libtomahawk/TomahawkSettingsGui.cpp b/src/libtomahawk/TomahawkSettingsGui.cpp index e91025237..b9b95bfc1 100644 --- a/src/libtomahawk/TomahawkSettingsGui.cpp +++ b/src/libtomahawk/TomahawkSettingsGui.cpp @@ -88,6 +88,13 @@ TomahawkSettingsGui::~TomahawkSettingsGui() } +QString +TomahawkSettingsGui::storageCacheLocation() const +{ + return QDesktopServices::storageLocation( QDesktopServices::CacheLocation ) + "/InfoSystemCache/"; +} + + QStringList TomahawkSettingsGui::scannerPaths() const { diff --git a/src/libtomahawk/TomahawkSettingsGui.h b/src/libtomahawk/TomahawkSettingsGui.h index bac2cddd4..5be369562 100644 --- a/src/libtomahawk/TomahawkSettingsGui.h +++ b/src/libtomahawk/TomahawkSettingsGui.h @@ -39,6 +39,7 @@ public: explicit TomahawkSettingsGui( QObject* parent = 0 ); virtual ~TomahawkSettingsGui(); + virtual QString storageCacheLocation() const; virtual QStringList scannerPaths() const; AtticaManager::StateHash atticaResolverStates() const; diff --git a/src/libtomahawk/infosystem/infosystemcache.cpp b/src/libtomahawk/infosystem/infosystemcache.cpp index c48f542d7..ada7edfe3 100644 --- a/src/libtomahawk/infosystem/infosystemcache.cpp +++ b/src/libtomahawk/infosystem/infosystemcache.cpp @@ -40,11 +40,7 @@ namespace InfoSystem InfoSystemCache::InfoSystemCache( QObject* parent ) : QObject( parent ) -#ifndef ENABLE_HEADLESS - , m_cacheBaseDir( QDesktopServices::storageLocation( QDesktopServices::CacheLocation ) + "/InfoSystemCache/" ) -#else - , m_cacheBaseDir( QDir::tempPath() ) -#endif + , m_cacheBaseDir( TomahawkSettings::instance()->storageCacheLocation() + "/InfoSystemCache/" ) , m_cacheVersion( 2 ) { tDebug() << Q_FUNC_INFO; diff --git a/src/libtomahawk/tomahawksettings.cpp b/src/libtomahawk/tomahawksettings.cpp index ea0523854..ff1d3b626 100644 --- a/src/libtomahawk/tomahawksettings.cpp +++ b/src/libtomahawk/tomahawksettings.cpp @@ -219,6 +219,13 @@ TomahawkSettings::infoSystemCacheVersion() const } +QString +TomahawkSettings::storageCacheLocation() const +{ + return QDir::tempPath() + "/tomahawk/"; +} + + QStringList TomahawkSettings::scannerPaths() const { diff --git a/src/libtomahawk/tomahawksettings.h b/src/libtomahawk/tomahawksettings.h index e5ca16643..817352b96 100644 --- a/src/libtomahawk/tomahawksettings.h +++ b/src/libtomahawk/tomahawksettings.h @@ -41,6 +41,7 @@ public: void applyChanges() { emit changed(); } /// General settings + virtual QString storageCacheLocation() const; virtual QStringList scannerPaths() const; /// QDesktopServices::MusicLocation in TomahawkSettingsGui void setScannerPaths( const QStringList& paths ); bool hasScannerPaths() const;