From dfa24768a3243eda68d91f573050bf23f96da2dd Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 22 Oct 2011 11:33:06 +0200 Subject: Deprecate QDesktopServices::storageLocation/displayName Which required porting the related unittests to qstandardpaths Change-Id: I6eb63c46845f05cd29cc42b59872707526277c90 Reviewed-by: Thiago Macieira (Intel) --- src/gui/util/qdesktopservices.cpp | 17 ++++++----------- src/gui/util/qdesktopservices.h | 13 +++++++++++-- 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src/gui/util') diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index ab45c17dd3..4fbf0a59f3 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -270,21 +270,16 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme) */ /*! - \deprecated Use QStandardPaths::writableLocation() + \fn QString QDesktopServices::storageLocation(StandardLocation type) + \obsolete + Use QStandardPaths::writableLocation() */ -QString QDesktopServices::storageLocation(StandardLocation type) -{ - return QStandardPaths::writableLocation(static_cast(type)); -} - /*! - \deprecated Use QStandardPaths::displayName() + \fn QString QDesktopServices::displayName(StandardLocation type) + \obsolete + Use QStandardPaths::displayName() */ -QString QDesktopServices::displayName(StandardLocation type) -{ - return QStandardPaths::displayName(static_cast(type)); -} QT_END_NAMESPACE diff --git a/src/gui/util/qdesktopservices.h b/src/gui/util/qdesktopservices.h index aba51959bd..ba7702f0d7 100644 --- a/src/gui/util/qdesktopservices.h +++ b/src/gui/util/qdesktopservices.h @@ -43,6 +43,9 @@ #define QDESKTOPSERVICES_H #include +#if QT_DEPRECATED_SINCE(5, 0) +#include +#endif QT_BEGIN_HEADER @@ -63,6 +66,7 @@ public: static void setUrlHandler(const QString &scheme, QObject *receiver, const char *method); static void unsetUrlHandler(const QString &scheme); +#if QT_DEPRECATED_SINCE(5, 0) enum StandardLocation { DesktopLocation, DocumentsLocation, @@ -77,8 +81,13 @@ public: CacheLocation }; - static QString storageLocation(StandardLocation type); - static QString displayName(StandardLocation type); + QT_DEPRECATED static QString storageLocation(StandardLocation type) { + return QStandardPaths::writableLocation(static_cast(type)); + } + QT_DEPRECATED static QString displayName(StandardLocation type) { + return QStandardPaths::displayName(static_cast(type)); + } +#endif }; #endif // QT_NO_DESKTOPSERVICES -- cgit v1.2.3