]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
fixup! Qt 5.12 compat (refactor)
authorgg <chown_tee@proton.me>
Fri, 16 Jan 2026 02:34:27 +0000 (21:34 -0500)
committergg <chown_tee@proton.me>
Fri, 16 Jan 2026 04:38:09 +0000 (23:38 -0500)
src/libwalletqt/Wallet.cpp
src/libwalletqt/rows/ConstructionInfo.h
src/utils/TxFiatHistory.cpp
src/utils/Utils.cpp
src/wizard/PageNetwork.cpp
src/wizard/PageWalletRestoreSeed.cpp

index 0927be53abd40c3d6081f3eb30eaf8d00bfe53b2..fbb36c90cf813543cb33eb4767f4f7a6bae86773 100644 (file)
@@ -364,7 +364,12 @@ QString Wallet::getSeed(const QString &seedOffset) const {
 }
 
 qsizetype Wallet::seedLength() const {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     auto seedLength = this->getCacheAttribute("feather.seed").split(" ", Qt::SkipEmptyParts).length();
+#else
+    auto seedLength = this->getCacheAttribute("feather.seed").split(" ", QString::SkipEmptyParts).length();
+#endif
+
     return seedLength ? seedLength : 25;
 }
 
@@ -670,8 +675,14 @@ void Wallet::syncDateRange(const QDate &start, const QDate &end) {
     QString filename = Utils::getRestoreHeightFilename(static_cast<NetworkType::Type>(nettype));
 
     std::unique_ptr<RestoreHeightLookup> lookup(RestoreHeightLookup::fromFile(filename, static_cast<NetworkType::Type>(nettype)));
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     uint64_t startHeight = lookup->dateToHeight(start.startOfDay().toSecsSinceEpoch());
     uint64_t endHeight = lookup->dateToHeight(end.startOfDay().toSecsSinceEpoch());
+#else
+    // Legacy Qt 5.12
+    uint64_t startHeight = lookup->dateToHeight(QDateTime(start, QTime(0, 0, 0)).toSecsSinceEpoch());
+    uint64_t endHeight = lookup->dateToHeight(QDateTime(end, QTime(0, 0, 0)).toSecsSinceEpoch());
+#endif
 
     if (startHeight >= endHeight)
         return;
index b88d20b2dcddb2f5e908bc3446ee058b945beff5..c1a417b0fa7a4d0b0dba07755fb0f924b3458bf7 100644 (file)
@@ -5,6 +5,7 @@
 #define FEATHER_CONSTRUCTIONINFO_H
 
 #include <QSet>
+#include <QVector>  // Qt 5.12 support (Ubuntu 20.04)
 
 #include "Output.h"
 #include "Input.h"
index 17f9b13514c607df04869b6a5e35ec5864b44a8b..59018c6644a99cecce937a496c5096074c8f4627 100644 (file)
@@ -4,6 +4,8 @@
 #include "TxFiatHistory.h"
 
 #include <QJsonObject>
+#include <QDebug> // For Qt5 compatibility
+#include <QSet>  // For Qt5 compatibility
 
 #include "utils/Utils.h"
 
index d9e42776f4893f2994c133420d912e2ec2ce2da2..221d9f8b00c04ee967b03a413b497031adedb5bd 100644 (file)
@@ -72,7 +72,12 @@ QString loadQrc(const QString &qrc) {
 bool fileWrite(const QString &path, const QString &data) {
     QFile file(path);
     if (file.open(QIODevice::WriteOnly)) {
-        QTextStream out(&file); out << data << Qt::endl;
+        QTextStream out(&file);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+        out << data << Qt::endl;
+#else
+        out << data << endl; // Legacy Qt 5.12 uses the global/stream 'endl'
+#endif
         file.close();
         return true;
     }
index 3ff23435dcd069b4366c8dbb19079a200db15ece..457aff1ff5aa69be8e3df743bf27883eaac82b51 100644 (file)
@@ -28,9 +28,15 @@ PageNetwork::PageNetwork(QWidget *parent)
     QPixmap infoIcon = QPixmap(":/assets/images/info2.svg");
     ui->infoIcon->setPixmap(infoIcon.scaledToWidth(32, Qt::SmoothTransformation));
 
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
     connect(ui->btnGroup_network, &QButtonGroup::idClicked, [this](int id) {
+#else
+    // Qt 5.12: Explicitly select the 'int' overload of buttonClicked
+    connect(ui->btnGroup_network, QOverload<int>::of(&QButtonGroup::buttonClicked), [this](int id) {
+#endif
         ui->frame_customNode->setVisible(id == Button::CUSTOM);
     });
+
     connect(ui->line_customNode, &QLineEdit::textEdited, [this]{
         this->completeChanged();
     });
index 8023d57859f83e9bb380658dedfeb4fa33733737..03ef4cad58f2351bcc6b3c26dd75dedb96ae35ce 100644 (file)
@@ -162,7 +162,11 @@ bool PageWalletRestoreSeed::validatePage() {
     seed = seed.replace("\n", " ").replace("\r", "").trimmed();
 
     auto errStyle = "QTextEdit{border: 1px solid red;}";
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     QStringList seedSplit = seed.split(" ", Qt::SkipEmptyParts);
+#else
+    QStringList seedSplit = seed.split(" ", QString::SkipEmptyParts);
+#endif
 
     if (seedSplit.length() != m_mode->length) {
         if (!(m_mode->type == Seed::Type::MONERO && seedSplit.length() == 24)) {