1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 08:24:43 -04:00

Remove use of deprecated QRegExp.

This commit is contained in:
srcejon
2024-06-10 14:01:57 +01:00
parent 4f822b4daf
commit 41716632d4
18 changed files with 256 additions and 210 deletions
+4 -3
View File
@@ -24,7 +24,7 @@
#include <QDesktopServices>
#include <QMessageBox>
#include <QAction>
#include <QRegExp>
#include <QRegularExpression>
#include <QClipboard>
#include <QFileDialog>
#include <QScrollBar>
@@ -636,9 +636,10 @@ void AISDemodGUI::filterRow(int row)
bool hidden = false;
if (m_settings.m_filterMMSI != "")
{
QRegExp re(m_settings.m_filterMMSI);
QRegularExpression re(QRegularExpression::anchoredPattern(m_settings.m_filterMMSI));
QTableWidgetItem *fromItem = ui->messages->item(row, MESSAGE_COL_MMSI);
if (!re.exactMatch(fromItem->text()))
QRegularExpressionMatch match = re.match(fromItem->text());
if (!match.hasMatch())
hidden = true;
}
ui->messages->setRowHidden(row, hidden);
@@ -23,7 +23,6 @@
#include <QDebug>
#include <QMessageBox>
#include <QAction>
#include <QRegExp>
#include <QFileDialog>
#include <QFileInfo>
#include <QGraphicsScene>
+4 -3
View File
@@ -21,7 +21,7 @@
#include <QDebug>
#include <QAction>
#include <QRegExp>
#include <QRegularExpression>
#include "dabdemodgui.h"
@@ -423,9 +423,10 @@ void DABDemodGUI::filterRow(int row)
bool hidden = false;
if (m_settings.m_filter != "")
{
QRegExp re(m_settings.m_filter);
QRegularExpression re(m_settings.m_filter);
QTableWidgetItem *fromItem = ui->programs->item(row, PROGRAMS_COL_NAME);
if (re.indexIn(fromItem->text()) == -1)
QRegularExpressionMatch match = re.match(fromItem->text());
if (!match.hasMatch())
hidden = true;
}
ui->programs->setRowHidden(row, hidden);
+3 -3
View File
@@ -22,7 +22,6 @@
#include <QAction>
#include <QClipboard>
#include <QFileDialog>
#include <QRegExp>
#include <QScrollBar>
#include <QMenu>
#include <QDesktopServices>
@@ -467,8 +466,9 @@ void DSCDemodGUI::filterRow(int row)
if (m_settings.m_filter != "")
{
QTableWidgetItem *item = ui->messages->item(row, m_settings.m_filterColumn);
QRegExp re(m_settings.m_filter);
if (!re.exactMatch(item->text())) {
QRegularExpression re(m_settings.m_filter);
QRegularExpressionMatch match = re.match(item->text());
if (!match.hasMatch()) {
hidden = true;
}
}
@@ -20,7 +20,7 @@
#include <QDebug>
#include <QMessageBox>
#include <QAction>
#include <QRegExp>
#include <QRegularExpression>
#include <QFileDialog>
#include <QScrollBar>
@@ -345,9 +345,10 @@ void EndOfTrainDemodGUI::filterRow(int row)
bool hidden = false;
if (m_settings.m_filterFrom != "")
{
QRegExp re(m_settings.m_filterFrom);
QRegularExpression re(QRegularExpression::anchoredPattern(m_settings.m_filterFrom));
QTableWidgetItem *fromItem = ui->packets->item(row, PACKETS_COL_ADDRESS);
if (!re.exactMatch(fromItem->text()))
QRegularExpressionMatch match = re.match(fromItem->text());
if (!match.hasMatch())
hidden = true;
}
ui->packets->setRowHidden(row, hidden);
@@ -19,7 +19,7 @@
#include <QDebug>
#include <QMessageBox>
#include <QAction>
#include <QRegExp>
#include <QRegularExpression>
#include <QFileDialog>
#include <QScrollBar>
@@ -330,16 +330,18 @@ void PacketDemodGUI::filterRow(int row)
bool hidden = false;
if (m_settings.m_filterFrom != "")
{
QRegExp re(m_settings.m_filterFrom);
QRegularExpression re(QRegularExpression::anchoredPattern(m_settings.m_filterFrom));
QTableWidgetItem *fromItem = ui->packets->item(row, PACKET_COL_FROM);
if (!re.exactMatch(fromItem->text()))
QRegularExpressionMatch match = re.match(fromItem->text());
if (!match.hasMatch())
hidden = true;
}
if (m_settings.m_filterTo != "")
{
QRegExp re(m_settings.m_filterTo);
QRegularExpression re(QRegularExpression::anchoredPattern(m_settings.m_filterTo));
QTableWidgetItem *toItem = ui->packets->item(row, PACKET_COL_TO);
if (!re.exactMatch(toItem->text()))
QRegularExpressionMatch match = re.match(toItem->text());
if (!match.hasMatch())
hidden = true;
}
if (m_settings.m_filterPID != "")
@@ -20,7 +20,7 @@
#include <QDesktopServices>
#include <QMessageBox>
#include <QAction>
#include <QRegExp>
#include <QRegularExpression>
#include <QClipboard>
#include <QFileDialog>
#include <QScrollBar>
@@ -473,9 +473,10 @@ void RadiosondeDemodGUI::filterRow(int row)
bool hidden = false;
if (m_settings.m_filterSerial != "")
{
QRegExp re(m_settings.m_filterSerial);
QRegularExpression re(QRegularExpression::anchoredPattern(m_settings.m_filterSerial));
QTableWidgetItem *fromItem = ui->frames->item(row, FRAME_COL_SERIAL);
if (!re.exactMatch(fromItem->text()))
QRegularExpressionMatch match = re.match(fromItem->text());
if (!match.hasMatch())
hidden = true;
}
ui->frames->setRowHidden(row, hidden);
@@ -26,7 +26,7 @@
#include <QDebug>
#include <QMessageBox>
#include <QAction>
#include <QRegExp>
#include <QRegularExpression>
#include <QClipboard>
#include <QFileDialog>
#include <QImage>
@@ -6054,10 +6054,11 @@ void RadioAstronomyGUI::networkManagerFinished(QNetworkReply *reply)
else
{
QString answer = reply->readAll();
QRegExp re("a href=\\\"download.php([^\"]*)\"");
if (re.indexIn(answer) != -1)
QRegularExpression re("a href=\\\"download.php([^\"]*)\"");
QRegularExpressionMatch match = re.match(answer);
if (match.hasMatch())
{
QString filename = re.capturedTexts()[1];
QString filename = match.capturedTexts()[1];
qDebug() << "RadioAstronomyGUI: Downloading LAB reference data: " << filename;
m_dlm.download(QUrl("https://www.astro.uni-bonn.de/hisurvey/euhou/LABprofile/download.php" + filename), m_filenameLAB);
}