diff options
author | Bernhard Beschow <shentey@gmail.com> | 2017-11-11 12:42:01 +0100 |
---|---|---|
committer | Bernhard Beschow <shentey@gmail.com> | 2018-12-19 13:24:33 +0000 |
commit | 88839a8cfa0bcf093fe7e96820c29316e6c28334 (patch) | |
tree | aa3b2ea6506463601d568849057dedef06cd09a0 /src/libs/extensionsystem | |
parent | d76c869e5635f4e3b2510658f6402f300a5835e7 (diff) | |
download | qt-creator-88839a8cfa0bcf093fe7e96820c29316e6c28334.tar.gz |
Const'ify two static variables
Even though the variables are local, they were exposed as writable
references. Turning those variables into constants and propagating the
constness prevents accidental modifications.
Change-Id: If874ae4995fb95434ad28da6682c980f90666061
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/extensionsystem')
-rw-r--r-- | src/libs/extensionsystem/pluginspec.cpp | 4 | ||||
-rw-r--r-- | src/libs/extensionsystem/pluginspec_p.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 01b72b4d41..ef9ac19ea2 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -845,9 +845,9 @@ bool PluginSpecPrivate::provides(const QString &pluginName, const QString &plugi /*! \internal */ -QRegExp &PluginSpecPrivate::versionRegExp() +const QRegExp &PluginSpecPrivate::versionRegExp() { - static QRegExp reg(QLatin1String("([0-9]+)(?:[.]([0-9]+))?(?:[.]([0-9]+))?(?:_([0-9]+))?")); + static const QRegExp reg(QLatin1String("([0-9]+)(?:[.]([0-9]+))?(?:[.]([0-9]+))?(?:_([0-9]+))?")); return reg; } /*! diff --git a/src/libs/extensionsystem/pluginspec_p.h b/src/libs/extensionsystem/pluginspec_p.h index ee6944bf76..9d37ed9923 100644 --- a/src/libs/extensionsystem/pluginspec_p.h +++ b/src/libs/extensionsystem/pluginspec_p.h @@ -111,7 +111,7 @@ private: PluginSpec *q; bool reportError(const QString &err); - static QRegExp &versionRegExp(); + static const QRegExp &versionRegExp(); }; } // namespace Internal |