From ecba58500e752899cbd4cedcd78cf1e7b35b043e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 20 Apr 2012 14:09:55 +0200 Subject: [PATCH] Fix compilation of QDesktopServices without deprecated Change-Id: I9e225d32b3f7db403cf3eea6a277580b4b7410a7 Reviewed-by: Thiago Macieira --- src/gui/util/qdesktopservices.cpp | 6 +++--- src/gui/util/qdesktopservices.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 26aecadcf4..67b695424b 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -285,9 +285,9 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme) */ -QString QDesktopServices::storageLocationImpl(StandardLocation type) +QString QDesktopServices::storageLocationImpl(QStandardPaths::StandardLocation type) { - if (type == DataLocation) { + if (type == QStandardPaths::DataLocation) { // Preserve Qt 4 compatibility: // * QCoreApplication::applicationName() must default to empty // * Unix data location is under the "data/" subdirectory @@ -307,7 +307,7 @@ QString QDesktopServices::storageLocationImpl(StandardLocation type) + compatAppName; #endif } - return QStandardPaths::writableLocation(static_cast(type)); + return QStandardPaths::writableLocation(type); } QT_END_NAMESPACE diff --git a/src/gui/util/qdesktopservices.h b/src/gui/util/qdesktopservices.h index 280acaf277..e116cf1123 100644 --- a/src/gui/util/qdesktopservices.h +++ b/src/gui/util/qdesktopservices.h @@ -64,6 +64,7 @@ public: static void unsetUrlHandler(const QString &scheme); #if QT_DEPRECATED_SINCE(5, 0) + //Must match QStandardPaths::StandardLocation QT_DEPRECATED enum StandardLocation { DesktopLocation, DocumentsLocation, @@ -79,14 +80,14 @@ public: }; QT_DEPRECATED static QString storageLocation(StandardLocation type) { - return storageLocationImpl(type); + return storageLocationImpl(static_cast(type)); } QT_DEPRECATED static QString displayName(StandardLocation type) { return QStandardPaths::displayName(static_cast(type)); } #endif private: - static QString storageLocationImpl(StandardLocation type); + static QString storageLocationImpl(QStandardPaths::StandardLocation type); }; #endif // QT_NO_DESKTOPSERVICES