diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-08-07 17:02:49 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-09 21:25:24 +0200 |
commit | 73251f22f337c27ffaf0353fed7985cbaeae0bdb (patch) | |
tree | fcfe9a959931956fdb253a9576272db5c67c31fd /src | |
parent | 652d51eda6eaf8a06268e4e4cdf078e8771ad6ab (diff) |
Add a Qt-API style QStandardPaths::setTestModeEnabled
QStandardPaths::enableTestMode has a verb in the imperative ("enable")
as the core word in the name. That indicates an action. The function
should not have had a parameter.
Instead, add a Qt-style setXXXEnabled function.
[ChangeLog][QtCore][QStandardPaths] QStandardPaths::enableTestMode is
deprecated and is replaced by QStandardPaths::setTestModeEnabled.
Change-Id: Ib26ad72d7c635890d2cb22ae9d44cbda08a6f17c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qstandardpaths.cpp | 11 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths.h | 5 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index bd399f511e..ea917c90d9 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -347,6 +347,10 @@ QString QStandardPaths::displayName(StandardLocation type) /*! \fn void QStandardPaths::enableTestMode(bool testMode) + \obsolete Use QStandardPaths::setTestModeEnabled + */ +/*! + \fn void QStandardPaths::setTestModeEnabled(bool testMode) If \a testMode is true, this enables a special "test mode" in QStandardPaths, which changes writable locations @@ -369,10 +373,17 @@ QString QStandardPaths::displayName(StandardLocation type) static bool qsp_testMode = false; +#if QT_DEPRECATED_SINCE(5, 2) void QStandardPaths::enableTestMode(bool testMode) { qsp_testMode = testMode; } +#endif + +void QStandardPaths::setTestModeEnabled(bool testMode) +{ + qsp_testMode = testMode; +} /*! \fn void QStandardPaths::isTestModeEnabled() diff --git a/src/corelib/io/qstandardpaths.h b/src/corelib/io/qstandardpaths.h index d8b6d24f57..df9089ace7 100644 --- a/src/corelib/io/qstandardpaths.h +++ b/src/corelib/io/qstandardpaths.h @@ -89,7 +89,10 @@ public: static QString findExecutable(const QString &executableName, const QStringList &paths = QStringList()); - static void enableTestMode(bool testMode); +#if QT_DEPRECATED_SINCE(5, 2) + static QT_DEPRECATED void enableTestMode(bool testMode); +#endif + static void setTestModeEnabled(bool testMode); static bool isTestModeEnabled(); private: |