chore(cpn): upgrade to Ubuntu 22.04 and Qt 6.9.0 (#5986)

Co-authored-by: elecpower <elecpower@users.noreply.github.com>
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
Neil Horne
2025-07-23 14:04:19 +02:00
committed by GitHub
co-authored by elecpower raphaelcoeffic
parent 7264b28e62
commit 9e86a3ea84
117 changed files with 4221 additions and 5155 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ set(${PROJECT_NAME}_HDRS
)
# AUTOMOC does not detect so manually process
qt5_wrap_cpp(${PROJECT_NAME}_SRCS
qt_wrap_cpp(${PROJECT_NAME}_SRCS
${${PROJECT_NAME}_HDRS}
)
@@ -58,7 +58,7 @@ add_library(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME}
PRIVATE
${CPN_COMMON_LIB}
Qt5::Svg
Qt::Svg
)
target_include_directories(${PROJECT_NAME}
+4 -4
View File
@@ -172,8 +172,8 @@ void DebugOutput::processBytesReceived()
const int sbValue = ui->console->verticalScrollBar()->value();
const bool sbAtBottom = (sbValue == ui->console->verticalScrollBar()->maximum());
while (m_dataBufferDevice && m_dataBufferDevice->bytesAvailable() > 0) {
text = m_dataBufferDevice->read(qint64(text.capacity()));
while (m_dataBufferDevice && m_dataBufferDevice->bytesAvailable() > 0) { // Note: bytesAvailable() returns a boolean - TODO why?
text = m_dataBufferDevice->read(DEBUG_OUTPUT_WIDGET_OUT_BUFF_SIZE);
if (text.isEmpty())
break;
ui->console->moveCursor(QTextCursor::End);
@@ -326,9 +326,9 @@ QRegularExpression DebugOutput::makeRegEx(const QString & input, bool * isExlusi
}
// no, convert arbitrary string to regex
else {
output.replace(QRegExp("^\\\\/"), "/"); // remove escape before fwd-slash ("\/...")
output.replace(QRegularExpression("^\\\\/"), "/"); // remove escape before fwd-slash ("\/...")
// escape all special chars except * and ?
output.replace(QRegExp("(\\\\|\\.|\\+|\\^|\\$|\\||\\)|\\(|\\]|\\[|\\}|\\{)"), "\\\\1");
output.replace(QRegularExpression("(\\\\|\\.|\\+|\\^|\\$|\\||\\)|\\(|\\]|\\[|\\}|\\{)"), "\\\\1");
output.replace("\\*", "\x30").replace("\\?", "\x31"); // save escaped wildcard chars
output.replace("*", ".*").replace("?", "."); // convert common wildcards
output.replace("\x30", "\\\\*").replace("\x31", "\\\\?"); // replace escaped wildcard chars
+3 -3
View File
@@ -375,10 +375,10 @@ void joystickDialog::on_okButton_clicked()
if (started && step < 4) {
int resp = QMessageBox::warning(this, CPN_STR_TTL_WARNING, tr("Calibration not complete, save anyway?"),
QDialogButtonBox::Ok | QMessageBox::Default, QDialogButtonBox::Cancel | QMessageBox::Escape, QMessageBox::NoButton);
if (resp == QDialogButtonBox::Cancel)
QMessageBox::Ok | QMessageBox::Cancel);
if (resp == QMessageBox::Cancel)
return;
}
}
g.clearJSData();
@@ -292,11 +292,7 @@ QWidget * RadioOutputsWidget::createLogicalSwitch(QWidget * parent, int switchNo
QFont font = swtch->font();
font.setBold(true);
swtch->setFont(font);
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
swtch->setMinimumWidth(swtch->fontMetrics().width("99") + 10);
#else
swtch->setMinimumWidth(swtch->fontMetrics().horizontalAdvance("99") + 10);
#endif
font.setBold(false);
swtch->setFont(font);
swtch->setText(QString("%1").arg(switchNo+1, 2, 10, QChar('0')));
+3 -2
View File
@@ -22,6 +22,7 @@
#include "simulatedgps.h"
#include <QtMath>
#include <QDebug>
#include <QTimeZone>
SimulatedGPS::SimulatedGPS()
{
@@ -109,7 +110,7 @@ void SimulatedGPS::update()
return;
}
dt = QDateTime::currentDateTime().toTimeSpec(Qt::UTC);
dt = QDateTime::currentDateTime().toTimeZone(QTimeZone::utc());
emitDateTimeChange();
double b2 = lat;
@@ -140,7 +141,7 @@ void SimulatedGPS::update()
lat = b3;
lon = c3;
emitPositionChange();
emitPositionChange();
}
void SimulatedGPS::emitPositionChange()
@@ -73,7 +73,7 @@ void SimulatorLoader::registerSimulators()
}
#if defined(__APPLE__)
dir = QLibraryInfo::location(QLibraryInfo::PrefixPath) + "/Resources";
dir.setPath(QLibraryInfo::path(QLibraryInfo::PrefixPath) + "/Resources");
#else
if (QDir::isAbsolutePath(SIMULATOR_LIB_SEARCH_PATH)) {
dir.setPath(SIMULATOR_LIB_SEARCH_PATH);
@@ -397,7 +397,7 @@ QString convertGPSDate(QString input)
// output is dd-MM-yyyy hh:mm:ss
QString localDateString = dateParts[2] + "-" + dateParts[1] + "-20" + dateParts[0] + " " + dateTime[1];
QString format("dd-MM-yyyy hh:mm:ss");
QDateTime utcDate = QDateTime::fromString(localDateString, format).toTimeSpec(Qt::UTC);
QDateTime utcDate = QDateTime::fromString(localDateString, format).toTimeZone(QTimeZone::UTC);
return utcDate.toString(format);
}
@@ -601,7 +601,7 @@ uint32_t TelemetryProviderFrSky::getNextGPSPacketData(uint32_t packetType)
void TelemetryProviderFrSky::setGPSDateTime(QString dateTime)
{
QDateTime dt = QDateTime::currentDateTime().toTimeSpec(Qt::UTC); // default to current systemtime
QDateTime dt = QDateTime::currentDateTime().toTimeZone(QTimeZone::UTC); // default to current systemtime
if (!dateTime.startsWith('*')) {
QString format("dd-MM-yyyy hh:mm:ss");
dt = QDateTime::fromString(dateTime, format);
@@ -679,9 +679,9 @@ void TelemetryProviderFrSky::on_saveTelemetryvalues_clicked()
out << ui -> cell6 -> text();
out<<"\r\n";
out << ui -> cell7 -> text();
out<<"\r\n";
out<<"\r\n";
out << ui -> cell8 -> text();
out<<"\r\n";
out<<"\r\n";
out << ui -> aspeed -> text();
out<<"\r\n";
out << ui -> gps_alt -> text();
@@ -830,7 +830,7 @@ void TelemetryProviderFrSky::on_loadTelemetryvalues_clicked()
n = in.readLine();
ns = n.toDouble();
ui -> cell7 -> setValue(ns);
n = in.readLine();
ns = n.toDouble();
ui -> cell8 -> setValue(ns);
+1 -1
View File
@@ -401,7 +401,7 @@ QString convertItemValue(QString sourceUnit, QString destUnit, QString value)
return value;
int i = 0;
while (conversions[i].source != NULL) {
while (!conversions[i].source.isNull()) {
if (conversions[i].source == sourceUnit && conversions[i].destination == destUnit) {
return ((conversions[i].converter)(value));
}
@@ -134,7 +134,7 @@ class ButtonsWidget : public QWidget
void paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
opt.initFrom(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}