mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-04-11 21:51:28 +03:00
Use a static qregexp instead of a temporary one
Qt complains
This commit is contained in:
@@ -113,7 +113,9 @@ void MainWindow::scanDevices()
|
|||||||
int startIndex = 0;
|
int startIndex = 0;
|
||||||
int endIndex = 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;
|
++endIndex;
|
||||||
QString jsonFragment = allDevicesOutput.mid(startIndex, endIndex - startIndex);
|
QString jsonFragment = allDevicesOutput.mid(startIndex, endIndex - startIndex);
|
||||||
deviceOutputs.append(jsonFragment);
|
deviceOutputs.append(jsonFragment);
|
||||||
|
|||||||
Reference in New Issue
Block a user