1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-05 00:22:31 +02:00

ifdefs--: abstract QDesktopServices away once again in TomahawkSettings

This commit is contained in:
Dominik Schmidt 2011-11-28 19:38:01 +01:00
parent 7c9fc46caa
commit 91f8ab27ee
5 changed files with 17 additions and 5 deletions

View File

@ -88,6 +88,13 @@ TomahawkSettingsGui::~TomahawkSettingsGui()
}
QString
TomahawkSettingsGui::storageCacheLocation() const
{
return QDesktopServices::storageLocation( QDesktopServices::CacheLocation ) + "/InfoSystemCache/";
}
QStringList
TomahawkSettingsGui::scannerPaths() const
{

View File

@ -39,6 +39,7 @@ public:
explicit TomahawkSettingsGui( QObject* parent = 0 );
virtual ~TomahawkSettingsGui();
virtual QString storageCacheLocation() const;
virtual QStringList scannerPaths() const;
AtticaManager::StateHash atticaResolverStates() const;

View File

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

View File

@ -219,6 +219,13 @@ TomahawkSettings::infoSystemCacheVersion() const
}
QString
TomahawkSettings::storageCacheLocation() const
{
return QDir::tempPath() + "/tomahawk/";
}
QStringList
TomahawkSettings::scannerPaths() const
{

View File

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