forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -845,9 +845,9 @@ bool PluginSpecPrivate::provides(const QString &pluginName, const QString &plugi
|
|||||||
/*!
|
/*!
|
||||||
\internal
|
\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;
|
return reg;
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ private:
|
|||||||
PluginSpec *q;
|
PluginSpec *q;
|
||||||
|
|
||||||
bool reportError(const QString &err);
|
bool reportError(const QString &err);
|
||||||
static QRegExp &versionRegExp();
|
static const QRegExp &versionRegExp();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -46,16 +46,16 @@ namespace Utils {
|
|||||||
// Naming a file like a device name will break on Windows, even if it is
|
// Naming a file like a device name will break on Windows, even if it is
|
||||||
// "com1.txt". Since we are cross-platform, we generally disallow such file
|
// "com1.txt". Since we are cross-platform, we generally disallow such file
|
||||||
// names.
|
// names.
|
||||||
static QRegExp &windowsDeviceNoSubDirPattern()
|
static const QRegExp &windowsDeviceNoSubDirPattern()
|
||||||
{
|
{
|
||||||
static QRegExp rc(QLatin1String(WINDOWS_DEVICES), Qt::CaseInsensitive);
|
static const QRegExp rc(QLatin1String(WINDOWS_DEVICES), Qt::CaseInsensitive);
|
||||||
QTC_ASSERT(rc.isValid(), return rc);
|
QTC_ASSERT(rc.isValid(), return rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QRegExp &windowsDeviceSubDirPattern()
|
static const QRegExp &windowsDeviceSubDirPattern()
|
||||||
{
|
{
|
||||||
static QRegExp rc(QLatin1String(".*[/\\\\](" WINDOWS_DEVICES ")"), Qt::CaseInsensitive);
|
static const QRegExp rc(QLatin1String(".*[/\\\\](" WINDOWS_DEVICES ")"), Qt::CaseInsensitive);
|
||||||
QTC_ASSERT(rc.isValid(), return rc);
|
QTC_ASSERT(rc.isValid(), return rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user