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:
@@ -46,16 +46,16 @@ namespace Utils {
|
||||
// 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
|
||||
// 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);
|
||||
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);
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user