From 45c6396b0ade8084e7bfdb72746e732745973a4c Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sat, 5 Jan 2013 16:46:42 +0100 Subject: [PATCH] qt5: use QStandardPaths in TomahawkSettings --- src/libtomahawk/TomahawkSettingsGui.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libtomahawk/TomahawkSettingsGui.cpp b/src/libtomahawk/TomahawkSettingsGui.cpp index 7bf2d6504..7db806613 100644 --- a/src/libtomahawk/TomahawkSettingsGui.cpp +++ b/src/libtomahawk/TomahawkSettingsGui.cpp @@ -18,7 +18,11 @@ #include "TomahawkSettingsGui.h" +#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) +#include +#else #include +#endif using namespace Tomahawk; @@ -82,7 +86,11 @@ TomahawkSettingsGui::~TomahawkSettingsGui() QString TomahawkSettingsGui::storageCacheLocation() const { +#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) + return QStandardPaths::writableLocation( QStandardPaths::CacheLocation ); +#else return QDesktopServices::storageLocation( QDesktopServices::CacheLocation ); +#endif } @@ -91,7 +99,11 @@ TomahawkSettingsGui::scannerPaths() const { QString musicLocation; +#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) + musicLocation = QStandardPaths::writableLocation( QStandardPaths::MusicLocation ); +#else musicLocation = QDesktopServices::storageLocation( QDesktopServices::MusicLocation ); +#endif return value( "scanner/paths", musicLocation ).toStringList(); }