mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
efb98cfd69
commit
eefd58a5c8
1 changed files with 4 additions and 5 deletions
|
@ -333,14 +333,13 @@ void BtDeviceSelectionDialog::pairingFinished(const QBluetoothAddress &address,
|
||||||
|
|
||||||
// Find the items which represent the BTH device and update their state
|
// Find the items which represent the BTH device and update their state
|
||||||
QList<QListWidgetItem *> items = ui->discoveredDevicesList->findItems(remoteDeviceStringAddress, Qt::MatchContains);
|
QList<QListWidgetItem *> items = ui->discoveredDevicesList->findItems(remoteDeviceStringAddress, Qt::MatchContains);
|
||||||
QRegularExpression pairingExpression = QRegularExpression(QString("%1|%2|%3").arg(tr("PAIRED"),
|
QRegularExpression pairingExpression(QString("%1|%2|%3").arg(tr("PAIRED"),
|
||||||
tr("AUTHORIZED_PAIRED"),
|
tr("AUTHORIZED_PAIRED"),
|
||||||
tr("UNPAIRED")));
|
tr("UNPAIRED")));
|
||||||
|
|
||||||
for (int i = 0; i < items.count(); ++i) {
|
for (int i = 0; i < items.count(); ++i) {
|
||||||
QListWidgetItem *item = items.at(i);
|
QListWidgetItem *item = items.at(i);
|
||||||
QString updatedDeviceLabel = item->text().replace(QRegularExpression(pairingExpression),
|
QString updatedDeviceLabel = item->text().replace(pairingExpression, pairingStatusLabel);
|
||||||
pairingStatusLabel);
|
|
||||||
|
|
||||||
item->setText(updatedDeviceLabel);
|
item->setText(updatedDeviceLabel);
|
||||||
item->setBackgroundColor(pairingColor);
|
item->setBackgroundColor(pairingColor);
|
||||||
|
|
Loading…
Reference in a new issue