From eefd58a5c8f8b5f7d3f01e74c94e27de4c896cba Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 6 Jun 2019 11:45:02 +0200 Subject: Cleanup: remove unnecessary QRegularExpression copies A regular expression was generated and then copied twice without apparent reason. Remove these copies. Signed-off-by: Berthold Stoeger --- desktop-widgets/btdeviceselectiondialog.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp index bf56005d3..1bb675e46 100644 --- a/desktop-widgets/btdeviceselectiondialog.cpp +++ b/desktop-widgets/btdeviceselectiondialog.cpp @@ -333,14 +333,13 @@ void BtDeviceSelectionDialog::pairingFinished(const QBluetoothAddress &address, // Find the items which represent the BTH device and update their state QList items = ui->discoveredDevicesList->findItems(remoteDeviceStringAddress, Qt::MatchContains); - QRegularExpression pairingExpression = QRegularExpression(QString("%1|%2|%3").arg(tr("PAIRED"), - tr("AUTHORIZED_PAIRED"), - tr("UNPAIRED"))); + QRegularExpression pairingExpression(QString("%1|%2|%3").arg(tr("PAIRED"), + tr("AUTHORIZED_PAIRED"), + tr("UNPAIRED"))); for (int i = 0; i < items.count(); ++i) { QListWidgetItem *item = items.at(i); - QString updatedDeviceLabel = item->text().replace(QRegularExpression(pairingExpression), - pairingStatusLabel); + QString updatedDeviceLabel = item->text().replace(pairingExpression, pairingStatusLabel); item->setText(updatedDeviceLabel); item->setBackgroundColor(pairingColor); -- cgit v1.2.3-70-g09d2