mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 13:17:34 +02:00
qt5: use QStandardPaths in TomahawkSettings
This commit is contained in:
@@ -18,7 +18,11 @@
|
|||||||
|
|
||||||
#include "TomahawkSettingsGui.h"
|
#include "TomahawkSettingsGui.h"
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||||
|
#include <QStandardPaths>
|
||||||
|
#else
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -82,7 +86,11 @@ TomahawkSettingsGui::~TomahawkSettingsGui()
|
|||||||
QString
|
QString
|
||||||
TomahawkSettingsGui::storageCacheLocation() const
|
TomahawkSettingsGui::storageCacheLocation() const
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||||
|
return QStandardPaths::writableLocation( QStandardPaths::CacheLocation );
|
||||||
|
#else
|
||||||
return QDesktopServices::storageLocation( QDesktopServices::CacheLocation );
|
return QDesktopServices::storageLocation( QDesktopServices::CacheLocation );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -91,7 +99,11 @@ TomahawkSettingsGui::scannerPaths() const
|
|||||||
{
|
{
|
||||||
QString musicLocation;
|
QString musicLocation;
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||||
|
musicLocation = QStandardPaths::writableLocation( QStandardPaths::MusicLocation );
|
||||||
|
#else
|
||||||
musicLocation = QDesktopServices::storageLocation( QDesktopServices::MusicLocation );
|
musicLocation = QDesktopServices::storageLocation( QDesktopServices::MusicLocation );
|
||||||
|
#endif
|
||||||
|
|
||||||
return value( "scanner/paths", musicLocation ).toStringList();
|
return value( "scanner/paths", musicLocation ).toStringList();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user