Use a static qregexp instead of a temporary one

Qt complains
This commit is contained in:
Spiros
2024-06-09 23:47:47 +03:00
parent c2f235b81d
commit 62e883ec13

View File

@@ -113,7 +113,9 @@ void MainWindow::scanDevices()
int startIndex = 0;
int endIndex = 0;
while ((endIndex = allDevicesOutput.indexOf(QRegularExpression("\\}\\n\\{"), startIndex)) != -1) {
static const QRegularExpression re("\\}\\n\\{");
while ((endIndex = allDevicesOutput.indexOf(re, startIndex)) != -1) {
++endIndex;
QString jsonFragment = allDevicesOutput.mid(startIndex, endIndex - startIndex);
deviceOutputs.append(jsonFragment);