aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qbsprojectmanager
diff options
context:
space:
mode:
authorAlessandro Portale <[email protected]>2024-11-20 12:19:53 +0100
committerAlessandro Portale <[email protected]>2024-11-20 12:19:42 +0000
commit116d5224e9409c4ed9b914a92b9d5ca9675fb357 (patch)
tree312e400b0381e73cbc91b20472c847b0ff278dd8 /src/plugins/qbsprojectmanager
parent7c97a2b9f81adefc4fa03908e84865d77f5c4b5a (diff)
Plugins M-V: Make static QRegularExpression instances static const
Diffstat (limited to 'src/plugins/qbsprojectmanager')
-rw-r--r--src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp2
-rw-r--r--src/plugins/qbsprojectmanager/qbsprofilemanager.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
index f3caa25d261..0ea8d83e55d 100644
--- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
+++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
@@ -361,7 +361,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
}
if (targetAbi.os() == ProjectExplorer::Abi::DarwinOS) {
// Reverse engineer the Xcode developer path from the compiler path
- const QRegularExpression compilerRe(
+ static const QRegularExpression compilerRe(
QStringLiteral("^(?<developerpath>.*)/Toolchains/(?:.+)\\.xctoolchain/usr/bin$"));
const QRegularExpressionMatch compilerReMatch = compilerRe.match(cxxCompilerPath.absolutePath().toString());
if (compilerReMatch.hasMatch()) {
diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp
index b7f831b8dee..8fea3e1a2ed 100644
--- a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp
+++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp
@@ -48,7 +48,8 @@ static QString toJSLiteral(const bool b)
static QString toJSLiteral(const QString &str)
{
QString js = str;
- js.replace(QRegularExpression("([\\\\\"])"), "\\\\1");
+ static const QRegularExpression regexp("([\\\\\"])");
+ js.replace(regexp, "\\\\1");
js.prepend('"');
js.append('"');
return js;