mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
Remove use of deprecated QRegExp.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1147,9 +1147,10 @@ void APRSGUI::filterMessageRow(int row)
|
||||
bool hidden = false;
|
||||
if (m_settings.m_filterAddressee != "")
|
||||
{
|
||||
QRegExp re(m_settings.m_filterAddressee);
|
||||
QRegularExpression re(m_settings.m_filterAddressee);
|
||||
QTableWidgetItem *addressee = ui->messagesTable->item(row, MESSAGE_COL_ADDRESSEE);
|
||||
if (!re.exactMatch(addressee->text()))
|
||||
QRegularExpressionMatch match = re.match(addressee->text());
|
||||
if (!match.hasMatch())
|
||||
hidden = true;
|
||||
}
|
||||
ui->messagesTable->setRowHidden(row, hidden);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <QHash>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
|
||||
struct SatNogsTransmitter {
|
||||
|
||||
@@ -196,10 +196,11 @@ struct SatNogsSatellite {
|
||||
// tle0 is of the form:
|
||||
// MOZHAYETS 4 (RS-22)
|
||||
// GOES 9 [-]
|
||||
QRegExp re("([A-Za-z0-9\\- ]+)([\\(]([A-Z0-9\\- ]+)[\\)])?");
|
||||
if (re.indexIn(tle->m_tle0) != -1)
|
||||
QRegularExpression re("([A-Za-z0-9\\- ]+)([\\(]([A-Z0-9\\- ]+)[\\)])?");
|
||||
QRegularExpressionMatch match = re.match(tle->m_tle0);
|
||||
if (match.hasMatch())
|
||||
{
|
||||
QStringList groups = re.capturedTexts();
|
||||
QStringList groups = match.capturedTexts();
|
||||
m_name = groups[1].trimmed();
|
||||
if ((groups.size() >= 4) && (groups[3] != "-") && !groups[3].isEmpty())
|
||||
m_names = QStringList({groups[3].trimmed()});
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <algorithm>
|
||||
#include <QMessageBox>
|
||||
#include <QLineEdit>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QGraphicsScene>
|
||||
@@ -1253,8 +1253,8 @@ void StarTrackerGUI::plotGalacticLineOfSight()
|
||||
}
|
||||
|
||||
// Calculate Galactic longitude we're observing
|
||||
float ra = Astronomy::raToDecimal(m_settings.m_ra);
|
||||
float dec = Astronomy::decToDecimal(m_settings.m_dec);
|
||||
float ra = Units::raToDecimal(m_settings.m_ra);
|
||||
float dec = Units::decToDecimal(m_settings.m_dec);
|
||||
double l, b;
|
||||
Astronomy::equatorialToGalactic(ra, dec, l, b);
|
||||
|
||||
@@ -1365,8 +1365,8 @@ void StarTrackerGUI::plotSkyTemperatureChart()
|
||||
}
|
||||
|
||||
QScatterSeries *series = new QScatterSeries();
|
||||
float ra = Astronomy::raToDecimal(m_settings.m_ra);
|
||||
float dec = Astronomy::decToDecimal(m_settings.m_dec);
|
||||
float ra = Units::raToDecimal(m_settings.m_ra);
|
||||
float dec = Units::decToDecimal(m_settings.m_dec);
|
||||
|
||||
double beamWidth = m_settings.m_beamwidth;
|
||||
// Ellipse not supported, so draw circle on shorter axis
|
||||
@@ -1664,8 +1664,8 @@ void StarTrackerGUI::plotElevationLineChart()
|
||||
}
|
||||
else
|
||||
{
|
||||
rd.ra = Astronomy::raToDecimal(m_settings.m_ra);
|
||||
rd.dec = Astronomy::decToDecimal(m_settings.m_dec);
|
||||
rd.ra = Units::raToDecimal(m_settings.m_ra);
|
||||
rd.dec = Units::decToDecimal(m_settings.m_dec);
|
||||
aa = Astronomy::raDecToAzAlt(rd, m_settings.m_latitude, m_settings.m_longitude, dt, !m_settings.m_jnow);
|
||||
}
|
||||
|
||||
@@ -1850,8 +1850,8 @@ void StarTrackerGUI::plotElevationPolarChart()
|
||||
}
|
||||
else
|
||||
{
|
||||
rd.ra = Astronomy::raToDecimal(m_settings.m_ra);
|
||||
rd.dec = Astronomy::decToDecimal(m_settings.m_dec);
|
||||
rd.ra = Units::raToDecimal(m_settings.m_ra);
|
||||
rd.dec = Units::decToDecimal(m_settings.m_dec);
|
||||
aa = Astronomy::raDecToAzAlt(rd, m_settings.m_latitude, m_settings.m_longitude, dt, !m_settings.m_jnow);
|
||||
}
|
||||
|
||||
@@ -2282,12 +2282,13 @@ bool StarTrackerGUI::readSolarFlux()
|
||||
// 000000 000019 000027 000037 000056 000073 000116 000202 000514 sfu
|
||||
// Occasionally, file will contain ////// in a column, presumably to indicate no data
|
||||
// Values can be negative
|
||||
QRegExp re("([0-9]{2})([0-9]{2})([0-9]{2}) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+)");
|
||||
QRegularExpression re("([0-9]{2})([0-9]{2})([0-9]{2}) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+) (-?[0-9\\/]+)");
|
||||
QRegularExpressionMatch match = re.match(string);
|
||||
|
||||
if (re.indexIn(string) != -1)
|
||||
if (match.hasMatch())
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
m_solarFluxes[i] = re.capturedTexts()[i+4].toInt();
|
||||
m_solarFluxes[i] = match.capturedTexts()[i+4].toInt();
|
||||
m_solarFluxesValid = true;
|
||||
displaySolarFlux();
|
||||
plotChart();
|
||||
@@ -2322,11 +2323,12 @@ void StarTrackerGUI::networkManagerFinished(QNetworkReply *reply)
|
||||
else
|
||||
{
|
||||
QString answer = reply->readAll();
|
||||
QRegExp re("\\<th\\>Observed Flux Density\\<\\/th\\>\\<td\\>([0-9]+(\\.[0-9]+)?)\\<\\/td\\>");
|
||||
QRegularExpression re("\\<th\\>Observed Flux Density\\<\\/th\\>\\<td\\>([0-9]+(\\.[0-9]+)?)\\<\\/td\\>");
|
||||
QRegularExpressionMatch match = re.match(answer);
|
||||
|
||||
if (re.indexIn(answer) != -1)
|
||||
if (match.hasMatch())
|
||||
{
|
||||
m_solarFlux = re.capturedTexts()[1].toDouble();
|
||||
m_solarFlux = match.capturedTexts()[1].toDouble();
|
||||
displaySolarFlux();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -580,8 +580,8 @@ void StarTrackerWorker::update()
|
||||
else
|
||||
{
|
||||
// Convert RA/Dec to Alt/Az
|
||||
rd.ra = Astronomy::raToDecimal(m_settings.m_ra);
|
||||
rd.dec = Astronomy::decToDecimal(m_settings.m_dec);
|
||||
rd.ra = Units::raToDecimal(m_settings.m_ra);
|
||||
rd.dec = Units::decToDecimal(m_settings.m_dec);
|
||||
aa = Astronomy::raDecToAzAlt(rd, m_settings.m_latitude, m_settings.m_longitude, dt, !m_settings.m_jnow);
|
||||
Astronomy::equatorialToGalactic(rd.ra, rd.dec, l, b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user