From 61352c849727666e09e33a79d1d3dc2547da3493 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 16:22:33 +0100 Subject: [PATCH 01/15] qt, refactor: Fix 'QFlags is deprecated' warnings - https://doc.qt.io/qt-5/qflags-obsolete.html - Qt::WindowFlags f = 0 in QWidget constructor signatures yields an invalid conversion from int to Qt::WindowType error. Replace with Qt::WindowFlags f = Qt::Widget. Qt::Widget value is 0. --- src/qt/komodoapp.cpp | 2 +- src/qt/splashscreen.cpp | 4 ++-- src/qt/splashscreen.h | 2 +- src/qt/utilitydialog.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qt/komodoapp.cpp b/src/qt/komodoapp.cpp index 7b73b41e..a56e2753 100644 --- a/src/qt/komodoapp.cpp +++ b/src/qt/komodoapp.cpp @@ -475,7 +475,7 @@ void KomodoApplication::createWindow(const NetworkStyle *networkStyle) void KomodoApplication::createSplashScreen(const NetworkStyle *networkStyle) { - SplashScreen *splash = new SplashScreen(0, networkStyle); + SplashScreen *splash = new SplashScreen(networkStyle); // We don't hold a direct pointer to the splash screen after creation, but the splash // screen will take care of deleting itself when slotFinish happens. splash->show(); diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 4c21c59d..9a80c59a 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -26,8 +26,8 @@ #include #include -SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) : - QWidget(0, f), curAlignment(0) +SplashScreen::SplashScreen(const NetworkStyle *networkStyle) : + QWidget(), curAlignment(0) { // set reference point, paddings int paddingRight = 50; diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h index a5e1511c..d6647cda 100644 --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -22,7 +22,7 @@ class SplashScreen : public QWidget Q_OBJECT public: - explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle); + explicit SplashScreen(const NetworkStyle *networkStyle); ~SplashScreen(); protected: diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h index 9f0bd117..83a9c301 100644 --- a/src/qt/utilitydialog.h +++ b/src/qt/utilitydialog.h @@ -41,7 +41,7 @@ class ShutdownWindow : public QWidget Q_OBJECT public: - explicit ShutdownWindow(QWidget *parent=0, Qt::WindowFlags f=0); + explicit ShutdownWindow(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget); static QWidget *showShutdownWindow(KomodoOceanGUI *window); protected: From 2157d33f1b9d1905930462e2e8c87569bbd70e1d Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 16:53:33 +0100 Subject: [PATCH 02/15] qt: Add TextWidth() wrapper In Qt 5.12 and before the QFontMetrics::width() is used and it is deprecated since Qt 13.0. In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced. - https://github.com/bitcoin/bitcoin/commit/1260ecd812e35185898fd555ad3e01d019072bcf --- src/qt/guiutil.cpp | 9 +++++++++ src/qt/guiutil.h | 7 +++++++ src/qt/komodoamountfield.cpp | 3 ++- src/qt/komodooceangui.cpp | 2 +- src/qt/sendcoinsdialog.cpp | 2 +- src/qt/splashscreen.cpp | 13 +++++++------ 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 063787e3..df03b222 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -1053,4 +1053,13 @@ void LogQtInfo() } } +int TextWidth(const QFontMetrics& fm, const QString& text) +{ +#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) + return fm.horizontalAdvance(text); +#else + return fm.width(text); +#endif +} + } // namespace GUIUtil diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 1521d519..794a64a7 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -244,6 +244,13 @@ namespace GUIUtil */ void LogQtInfo(); +/** + * Returns the distance in pixels appropriate for drawing a subsequent character after text. + * + * In Qt 5.12 and before the QFontMetrics::width() is used and it is deprecated since Qt 13.0. + * In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced. + */ +int TextWidth(const QFontMetrics& fm, const QString& text); } // namespace GUIUtil #endif // KOMODO_QT_GUIUTIL_H diff --git a/src/qt/komodoamountfield.cpp b/src/qt/komodoamountfield.cpp index b52048d2..2484dc3a 100644 --- a/src/qt/komodoamountfield.cpp +++ b/src/qt/komodoamountfield.cpp @@ -6,6 +6,7 @@ #include "komodounits.h" #include "guiconstants.h" +#include "guiutil.h" #include "qvaluecombobox.h" #include @@ -99,7 +100,7 @@ class AmountSpinBox: public QAbstractSpinBox const QFontMetrics fm(fontMetrics()); int h = lineEdit()->minimumSizeHint().height(); - int w = fm.width(KomodoUnits::format(KomodoUnits::KMD, KomodoUnits::maxMoney(), false, KomodoUnits::separatorAlways)); + int w = GUIUtil::TextWidth(fm, KomodoUnits::format(KomodoUnits::KMD, KomodoUnits::maxMoney(), false, KomodoUnits::separatorAlways)); w += 2; // cursor blinking space QStyleOptionSpinBox opt; diff --git a/src/qt/komodooceangui.cpp b/src/qt/komodooceangui.cpp index c28d7d2a..02822a5c 100644 --- a/src/qt/komodooceangui.cpp +++ b/src/qt/komodooceangui.cpp @@ -1267,7 +1267,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *pl const QFontMetrics fm(font()); for (const KomodoUnits::Unit unit : units) { - max_width = qMax(max_width, fm.width(KomodoUnits::name(unit))); + max_width = qMax(max_width, GUIUtil::TextWidth(fm, KomodoUnits::name(unit))); } setMinimumSize(max_width, 0); setAlignment(Qt::AlignRight | Qt::AlignVCenter); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 534077ed..96b4226c 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -710,7 +710,7 @@ void SendCoinsDialog::updateSmartFeeLabel() int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness(); QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14)); ui->fallbackFeeWarningLabel->setStyleSheet("QLabel { color: " + warning_colour.name() + "; }"); - ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(ui->fallbackFeeWarningLabel->font()).width("x")); + ui->fallbackFeeWarningLabel->setIndent(GUIUtil::TextWidth(QFontMetrics(ui->fallbackFeeWarningLabel->font()), "x")); } else { diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 9a80c59a..1b08d810 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -8,11 +8,12 @@ #include "splashscreen.h" -#include "networkstyle.h" - #include "clientversion.h" #include "init.h" #include "util.h" + +#include "guiutil.h" +#include "networkstyle.h" #include "ui_interface.h" #include "version.h" @@ -81,21 +82,21 @@ SplashScreen::SplashScreen(const NetworkStyle *networkStyle) : // check font size and drawing with pixPaint.setFont(QFont(font, 33*fontFactor)); QFontMetrics fm = pixPaint.fontMetrics(); - int titleTextWidth = fm.width(titleText); + int titleTextWidth = GUIUtil::TextWidth(fm, titleText); if (titleTextWidth > 176) { fontFactor = fontFactor * 176 / titleTextWidth; } pixPaint.setFont(QFont(font, 33*fontFactor)); fm = pixPaint.fontMetrics(); - titleTextWidth = fm.width(titleText); + titleTextWidth = GUIUtil::TextWidth(fm, titleText); pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight,paddingTop,titleText); pixPaint.setFont(QFont(font, 15*fontFactor)); // if the version string is to long, reduce size fm = pixPaint.fontMetrics(); - int versionTextWidth = fm.width(versionText); + int versionTextWidth = GUIUtil::TextWidth(fm, versionText); if(versionTextWidth > titleTextWidth+paddingRight-10) { pixPaint.setFont(QFont(font, 10*fontFactor)); titleVersionVSpace -= 5; @@ -117,7 +118,7 @@ SplashScreen::SplashScreen(const NetworkStyle *networkStyle) : boldFont.setWeight(QFont::Bold); pixPaint.setFont(boldFont); fm = pixPaint.fontMetrics(); - int titleAddTextWidth = fm.width(titleAddText); + int titleAddTextWidth = GUIUtil::TextWidth(fm, titleAddText); pixPaint.drawText(pixmap.width()/devicePixelRatio-titleAddTextWidth-10,15,titleAddText); } From b446564ee634da7f09a6fc889905b652e31683e1 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 17:17:48 +0100 Subject: [PATCH 03/15] qt: replace Qt::ItemFlags 0 with Qt::NoItemFlags --- src/qt/addresstablemodel.cpp | 3 +-- src/qt/bantablemodel.cpp | 3 +-- src/qt/peertablemodel.cpp | 3 +-- src/qt/zaddresstablemodel.cpp | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index 77e3f0bf..ed13eb63 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -366,8 +366,7 @@ QVariant AddressTableModel::headerData(int section, Qt::Orientation orientation, Qt::ItemFlags AddressTableModel::flags(const QModelIndex &index) const { - if(!index.isValid()) - return 0; + if (!index.isValid()) return Qt::NoItemFlags; AddressTableEntry *rec = static_cast(index.internalPointer()); Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index bdfc123b..27db5e0f 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -148,8 +148,7 @@ QVariant BanTableModel::headerData(int section, Qt::Orientation orientation, int Qt::ItemFlags BanTableModel::flags(const QModelIndex &index) const { - if(!index.isValid()) - return 0; + if(!index.isValid()) return Qt::NoItemFlags; Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; return retval; diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 592e7260..5e86221e 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -196,8 +196,7 @@ QVariant PeerTableModel::headerData(int section, Qt::Orientation orientation, in Qt::ItemFlags PeerTableModel::flags(const QModelIndex &index) const { - if(!index.isValid()) - return 0; + if(!index.isValid()) return Qt::NoItemFlags; Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; return retval; diff --git a/src/qt/zaddresstablemodel.cpp b/src/qt/zaddresstablemodel.cpp index 15bcbe5b..c5bfe37b 100644 --- a/src/qt/zaddresstablemodel.cpp +++ b/src/qt/zaddresstablemodel.cpp @@ -374,8 +374,7 @@ QVariant ZAddressTableModel::headerData(int section, Qt::Orientation orientation Qt::ItemFlags ZAddressTableModel::flags(const QModelIndex &index) const { - if(!index.isValid()) - return 0; + if(!index.isValid()) return Qt::NoItemFlags; AddressTableEntry *rec = static_cast(index.internalPointer()); Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; From 1bf11f435ee2e569a5968189487cb8fbd5946e26 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 18:06:54 +0100 Subject: [PATCH 04/15] qt: refactor: replace qLowerBound/qUpperBound/qSort with std:: --- src/qt/addresstablemodel.cpp | 8 ++++---- src/qt/recentrequeststablemodel.cpp | 2 +- src/qt/transactiontablemodel.cpp | 4 ++-- src/qt/zaddresstablemodel.cpp | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index ed13eb63..a275c47d 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -102,18 +102,18 @@ class AddressTablePriv QString::fromStdString(EncodeDestination(address)))); } } - // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order + // std::lower_bound() and std::upper_bound() require our cachedAddressTable list to be sorted in asc order // Even though the map is already sorted this re-sorting step is needed because the originating map // is sorted by binary address, not by base58() address. - qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan()); + std::sort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan()); } void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status) { // Find address / label in model - QList::iterator lower = qLowerBound( + QList::iterator lower = std::lower_bound( cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan()); - QList::iterator upper = qUpperBound( + QList::iterator upper = std::upper_bound( cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan()); int lowerIndex = (lower - cachedAddressTable.begin()); int upperIndex = (upper - cachedAddressTable.begin()); diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 77860e96..fb5e8f3b 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -206,7 +206,7 @@ void RecentRequestsTableModel::addNewRequest(RecentRequestEntry &recipient) void RecentRequestsTableModel::sort(int column, Qt::SortOrder order) { - qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order)); + std::sort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order)); Q_EMIT dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex())); } diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 7fc638fe..668d027e 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -98,9 +98,9 @@ class TransactionTablePriv qDebug() << "TransactionTablePriv::updateWallet: " + QString::fromStdString(hash.ToString()) + " " + QString::number(status); // Find bounds of this transaction in model - QList::iterator lower = qLowerBound( + QList::iterator lower = std::lower_bound( cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan()); - QList::iterator upper = qUpperBound( + QList::iterator upper = std::upper_bound( cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan()); int lowerIndex = (lower - cachedWallet.begin()); int upperIndex = (upper - cachedWallet.begin()); diff --git a/src/qt/zaddresstablemodel.cpp b/src/qt/zaddresstablemodel.cpp index c5bfe37b..ee087d24 100644 --- a/src/qt/zaddresstablemodel.cpp +++ b/src/qt/zaddresstablemodel.cpp @@ -107,18 +107,18 @@ class ZAddressTablePriv QString::fromStdString(EncodePaymentAddress(address)))); } } - // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order + // std::lower_bound() and std::upper_bound() require our cachedAddressTable list to be sorted in asc order // Even though the map is already sorted this re-sorting step is needed because the originating map // is sorted by binary address, not by base58() address. - qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan()); + std::sort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan()); } void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status) { // Find address / label in model - QList::iterator lower = qLowerBound( + QList::iterator lower = std::lower_bound( cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan()); - QList::iterator upper = qUpperBound( + QList::iterator upper = std::upper_bound( cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan()); int lowerIndex = (lower - cachedAddressTable.begin()); int upperIndex = (upper - cachedAddressTable.begin()); From 446e93c521b1a756d87e58f9fdc60da858553d49 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 18:25:39 +0100 Subject: [PATCH 05/15] qt: refactor 0 -> QAbstractSpinBox::StepEnabledFlag::StepNone --- src/qt/komodoamountfield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/komodoamountfield.cpp b/src/qt/komodoamountfield.cpp index 2484dc3a..8dd54e21 100644 --- a/src/qt/komodoamountfield.cpp +++ b/src/qt/komodoamountfield.cpp @@ -172,7 +172,7 @@ class AmountSpinBox: public QAbstractSpinBox if (text().isEmpty()) // Allow step-up with empty field return StepUpEnabled; - StepEnabled rv = 0; + StepEnabled rv = StepNone; bool valid = false; CAmount val = value(&valid); if(valid) From bf4a87a18b2c21a1320baccd80281788656d85f5 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 18:39:27 +0100 Subject: [PATCH 06/15] qt, refactor: Fix 'QDateTime is deprecated' warnings --- src/qt/guiutil.cpp | 8 ++++++++ src/qt/guiutil.h | 9 +++++++++ src/qt/rpcconsole.cpp | 1 + src/qt/rpcconsole.h | 1 + src/qt/transactionview.cpp | 16 ++++++++-------- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index df03b222..1ab8a8d8 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -1062,4 +1062,12 @@ int TextWidth(const QFontMetrics& fm, const QString& text) #endif } +QDateTime StartOfDay(const QDate& date) +{ +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) + return date.startOfDay(); +#else + return QDateTime(date); +#endif +} } // namespace GUIUtil diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 794a64a7..71b72669 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -250,7 +250,16 @@ namespace GUIUtil * In Qt 5.12 and before the QFontMetrics::width() is used and it is deprecated since Qt 13.0. * In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced. */ + int TextWidth(const QFontMetrics& fm, const QString& text); +/** + * Returns the start-moment of the day in local time. + * + * QDateTime::QDateTime(const QDate& date) is deprecated since Qt 5.15. + * QDate::startOfDay() was introduced in Qt 5.14. + */ +QDateTime StartOfDay(const QDate& date); + } // namespace GUIUtil #endif // KOMODO_QT_GUIUTIL_H diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 5208e280..64589282 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -29,6 +29,7 @@ #endif #include +#include #include #include #include diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 59884188..a31a3c5e 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -23,6 +23,7 @@ namespace Ui { } QT_BEGIN_NAMESPACE +class QDateTime; class QMenu; class QItemSelection; QT_END_NAMESPACE diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 12bffd5f..a36b4cb0 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -270,30 +270,30 @@ void TransactionView::chooseDate(int idx) break; case Today: transactionProxyModel->setDateRange( - QDateTime(current), + GUIUtil::StartOfDay(current), TransactionFilterProxy::MAX_DATE); break; case ThisWeek: { // Find last Monday QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1)); transactionProxyModel->setDateRange( - QDateTime(startOfWeek), + GUIUtil::StartOfDay(startOfWeek), TransactionFilterProxy::MAX_DATE); } break; case ThisMonth: transactionProxyModel->setDateRange( - QDateTime(QDate(current.year(), current.month(), 1)), + GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1)), TransactionFilterProxy::MAX_DATE); break; case LastMonth: transactionProxyModel->setDateRange( - QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)), - QDateTime(QDate(current.year(), current.month(), 1))); + GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1).addMonths(-1)), + GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1))); break; case ThisYear: transactionProxyModel->setDateRange( - QDateTime(QDate(current.year(), 1, 1)), + GUIUtil::StartOfDay(QDate(current.year(), 1, 1)), TransactionFilterProxy::MAX_DATE); break; case Range: @@ -534,8 +534,8 @@ void TransactionView::dateRangeChanged() if(!transactionProxyModel) return; transactionProxyModel->setDateRange( - QDateTime(dateFrom->date()), - QDateTime(dateTo->date()).addDays(1)); + GUIUtil::StartOfDay(dateFrom->date()), + GUIUtil::StartOfDay(dateTo->date()).addDays(1)); } void TransactionView::focusTransaction(const QModelIndex &idx) From 3d1ed09a48b96645de2e59248d0888feb1f647cd Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 19:05:06 +0100 Subject: [PATCH 07/15] qt, refactor: Fix 'split is deprecated' warnings --- src/qt/guiutil.h | 20 ++++++++++++++++++++ src/qt/optionsmodel.cpp | 16 ++++++++-------- src/qt/transactionview.cpp | 2 +- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 71b72669..e2fd1479 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -262,4 +262,24 @@ QDateTime StartOfDay(const QDate& date); } // namespace GUIUtil +/** + * Splits the string into substrings wherever separator occurs, and returns + * the list of those strings. Empty strings do not appear in the result. + * + * QString::split() signature differs in different Qt versions: + * - QString::SplitBehavior is deprecated since Qt 5.15 + * - Qt::SplitBehavior was introduced in Qt 5.14 + * If {QString|Qt}::SkipEmptyParts behavior is required, use this + * function instead of QString::split(). + */ +template +QStringList SplitSkipEmptyParts(const QString& string, const SeparatorType& separator) +{ +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) + return string.split(separator, Qt::SkipEmptyParts); +#else + return string.split(separator, QString::SkipEmptyParts); +#endif +} + #endif // KOMODO_QT_GUIUTIL_H diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 963eaae7..a47a6e3b 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -234,12 +234,12 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("fUseProxy", false); case ProxyIP: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); return strlIpPort.at(0); } case ProxyPort: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); return strlIpPort.at(1); } @@ -248,12 +248,12 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("fUseSeparateProxyTor", false); case ProxyIPTor: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = settings.value("addrSeparateProxyTor").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); return strlIpPort.at(0); } case ProxyPortTor: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = settings.value("addrSeparateProxyTor").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); return strlIpPort.at(1); } @@ -317,7 +317,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyIP: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); // if that key doesn't exist or has a changed IP if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) { // construct new value from new IP and current port @@ -329,7 +329,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyPort: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); // if that key doesn't exist or has a changed port if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) { // construct new value from current IP and new port @@ -349,7 +349,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyIPTor: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = settings.value("addrSeparateProxyTor").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); // if that key doesn't exist or has a changed IP if (!settings.contains("addrSeparateProxyTor") || strlIpPort.at(0) != value.toString()) { // construct new value from new IP and current port @@ -361,7 +361,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyPortTor: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = settings.value("addrSeparateProxyTor").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); // if that key doesn't exist or has a changed port if (!settings.contains("addrSeparateProxyTor") || strlIpPort.at(1) != value.toString()) { // construct new value from current IP and new port diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index a36b4cb0..2aff42fa 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -231,7 +231,7 @@ void TransactionView::setModel(WalletModel *_model) if (_model->getOptionsModel()) { // Add third party transaction URLs to context menu - QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts); + QStringList listUrls = SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|"); for (int i = 0; i < listUrls.size(); ++i) { QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host(); From 5cd7345011f7692c83ab0a7e0b4a51ef4ed42475 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 19:23:44 +0100 Subject: [PATCH 08/15] qt, refactor: Fix 'pixmap is deprecated' warnings + move SplitSkipEmptyParts to GUIUtil namespace --- src/qt/guiutil.cpp | 23 +++++++++++++++++++++++ src/qt/guiutil.h | 11 ++++++++++- src/qt/optionsmodel.cpp | 16 ++++++++-------- src/qt/receiverequestdialog.cpp | 12 +++++------- src/qt/transactionview.cpp | 2 +- 5 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 1ab8a8d8..48237708 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -1070,4 +1070,27 @@ QDateTime StartOfDay(const QDate& date) return QDateTime(date); #endif } + +bool HasPixmap(const QLabel* label) +{ +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + return !label->pixmap(Qt::ReturnByValue).isNull(); +#else + return label->pixmap() != nullptr; +#endif +} + +QImage GetImage(const QLabel* label) +{ + if (!HasPixmap(label)) { + return QImage(); + } + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + return label->pixmap(Qt::ReturnByValue).toImage(); +#else + return label->pixmap()->toImage(); +#endif +} + } // namespace GUIUtil diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index e2fd1479..5bc7d86a 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -260,7 +260,14 @@ int TextWidth(const QFontMetrics& fm, const QString& text); */ QDateTime StartOfDay(const QDate& date); -} // namespace GUIUtil + +/** + * Returns true if pixmap has been set. + * + * QPixmap* QLabel::pixmap() is deprecated since Qt 5.15. + */ +bool HasPixmap(const QLabel* label); +QImage GetImage(const QLabel* label); /** * Splits the string into substrings wherever separator occurs, and returns @@ -282,4 +289,6 @@ QStringList SplitSkipEmptyParts(const QString& string, const SeparatorType& sepa #endif } +} // namespace GUIUtil + #endif // KOMODO_QT_GUIUTIL_H diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index a47a6e3b..f80116c4 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -234,12 +234,12 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("fUseProxy", false); case ProxyIP: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); return strlIpPort.at(0); } case ProxyPort: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); return strlIpPort.at(1); } @@ -248,12 +248,12 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("fUseSeparateProxyTor", false); case ProxyIPTor: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); return strlIpPort.at(0); } case ProxyPortTor: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); return strlIpPort.at(1); } @@ -317,7 +317,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyIP: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); // if that key doesn't exist or has a changed IP if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) { // construct new value from new IP and current port @@ -329,7 +329,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyPort: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrProxy").toString(), ":"); // if that key doesn't exist or has a changed port if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) { // construct new value from current IP and new port @@ -349,7 +349,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyIPTor: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); // if that key doesn't exist or has a changed IP if (!settings.contains("addrSeparateProxyTor") || strlIpPort.at(0) != value.toString()) { // construct new value from new IP and current port @@ -361,7 +361,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyPortTor: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); + QStringList strlIpPort = GUIUtil::SplitSkipEmptyParts(settings.value("addrSeparateProxyTor").toString(), ":"); // if that key doesn't exist or has a changed port if (!settings.contains("addrSeparateProxyTor") || strlIpPort.at(1) != value.toString()) { // construct new value from current IP and new port diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp index 609cf30c..8792906d 100644 --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -43,14 +43,12 @@ QRImageWidget::QRImageWidget(QWidget *parent): QImage QRImageWidget::exportImage() { - if(!pixmap()) - return QImage(); - return pixmap()->toImage(); + return GUIUtil::GetImage(this); } void QRImageWidget::mousePressEvent(QMouseEvent *event) { - if(event->button() == Qt::LeftButton && pixmap()) + if(event->button() == Qt::LeftButton && GUIUtil::HasPixmap(this)) { event->accept(); QMimeData *mimeData = new QMimeData; @@ -66,7 +64,7 @@ void QRImageWidget::mousePressEvent(QMouseEvent *event) void QRImageWidget::saveImage() { - if(!pixmap()) + if(!GUIUtil::HasPixmap(this)) return; QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Image (*.png)"), nullptr); if (!fn.isEmpty()) @@ -77,14 +75,14 @@ void QRImageWidget::saveImage() void QRImageWidget::copyImage() { - if(!pixmap()) + if(!GUIUtil::HasPixmap(this)) return; QApplication::clipboard()->setImage(exportImage()); } void QRImageWidget::contextMenuEvent(QContextMenuEvent *event) { - if(!pixmap()) + if(!GUIUtil::HasPixmap(this)) return; contextMenu->exec(event->globalPos()); } diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 2aff42fa..57301643 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -231,7 +231,7 @@ void TransactionView::setModel(WalletModel *_model) if (_model->getOptionsModel()) { // Add third party transaction URLs to context menu - QStringList listUrls = SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|"); + QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|"); for (int i = 0; i < listUrls.size(); ++i) { QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host(); From 6bc2296cd74ec89ca74a37fb40c314ca6c84f9ff Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 19:34:57 +0100 Subject: [PATCH 09/15] qt, refactor: replace qStableSort with std::stable_sort --- src/qt/bantablemodel.cpp | 2 +- src/qt/peertablemodel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index 27db5e0f..598114f3 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -65,7 +65,7 @@ class BanTablePriv if (sortColumn >= 0) // sort cachedBanlist (use stable sort to prevent rows jumping around unnecessarily) - qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder)); + std::stable_sort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder)); } int size() const diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 5e86221e..d1f16936 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -86,7 +86,7 @@ class PeerTablePriv if (sortColumn >= 0) // sort cacheNodeStats (use stable sort to prevent rows jumping around unnecessarily) - qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder)); + std::stable_sort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder)); // build index map mapNodeRows.clear(); From a788eb8b6b82c0371de336767fb1ecb6f0621f43 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 19:58:17 +0100 Subject: [PATCH 10/15] qt, refactor: Remove obsolete QModelIndex::child() The QModelIndex::child() member function is obsolete since Qt 5.12. --- src/qt/receivecoinsdialog.cpp | 2 +- src/qt/recentrequeststablemodel.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 28746653..b2b9e797 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -251,7 +251,7 @@ void ReceiveCoinsDialog::copyColumnToClipboard(int column) if (!firstIndex.isValid()) { return; } - GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString()); + GUIUtil::setClipboard(model->getRecentRequestsTableModel()->index(firstIndex.row(), column).data(Qt::EditRole).toString()); } // context menu diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index ee885931..00954ae0 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -78,7 +78,7 @@ class RecentRequestsTableModel: public QAbstractTableModel QVariant data(const QModelIndex &index, int role) const; bool setData(const QModelIndex &index, const QVariant &value, int role); QVariant headerData(int section, Qt::Orientation orientation, int role) const; - QModelIndex index(int row, int column, const QModelIndex &parent) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); Qt::ItemFlags flags(const QModelIndex &index) const; /*@}*/ From 1afe2b012fdacae895ec71678c89758919c1883a Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 20:06:53 +0100 Subject: [PATCH 11/15] qt, refactor: Replace obsolete functions of QDesktopWidget --- src/qt/komodooceangui.cpp | 3 ++- src/qt/rpcconsole.cpp | 3 ++- src/qt/splashscreen.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qt/komodooceangui.cpp b/src/qt/komodooceangui.cpp index 02822a5c..0fe67f08 100644 --- a/src/qt/komodooceangui.cpp +++ b/src/qt/komodooceangui.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -129,7 +130,7 @@ KomodoOceanGUI::KomodoOceanGUI(const PlatformStyle *_platformStyle, const Networ QSettings settings; if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) { // Restore failed (perhaps missing setting), center the window - move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center()); + move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center()); } QString windowTitle = "[" + QString(chainName.ToString().c_str()) + "] "; diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 64589282..2b319b97 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -433,7 +434,7 @@ RPCConsole::RPCConsole(const PlatformStyle *_platformStyle, QWidget *parent) : QSettings settings; if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) { // Restore failed (perhaps missing setting), center the window - move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center()); + move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center()); } ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME))); diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 1b08d810..32c2e01f 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -23,9 +23,9 @@ #include #include -#include #include #include +#include SplashScreen::SplashScreen(const NetworkStyle *networkStyle) : QWidget(), curAlignment(0) @@ -131,7 +131,7 @@ SplashScreen::SplashScreen(const NetworkStyle *networkStyle) : QRect r(QPoint(), QSize(pixmap.size().width()/devicePixelRatio,pixmap.size().height()/devicePixelRatio)); resize(r.size()); setFixedSize(r.size()); - move(QApplication::desktop()->screenGeometry().center() - r.center()); + move(QGuiApplication::primaryScreen()->geometry().center() - r.center()); subscribeToCoreSignals(); installEventFilter(this); From 153cabe6252924222f45a3897f830855d1b93503 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 20:14:00 +0100 Subject: [PATCH 12/15] deal with _BSD_SOURCE and _SVID_SOURCE warning warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] --- src/cryptoconditions/src/asn/asn_system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryptoconditions/src/asn/asn_system.h b/src/cryptoconditions/src/asn/asn_system.h index 7e64ba10..26fa6434 100644 --- a/src/cryptoconditions/src/asn/asn_system.h +++ b/src/cryptoconditions/src/asn/asn_system.h @@ -13,8 +13,8 @@ #include "cryptoconditions-config.h" #endif -#ifndef _BSD_SOURCE -#define _BSD_SOURCE /* for snprintf() on some linux systems */ +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* for snprintf() on some Linux systems */ #endif #include /* For snprintf(3) */ From 5d7d597d04e555670ad881801057f9abd13db3c6 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 20:15:59 +0100 Subject: [PATCH 13/15] build: remove verbose flag from make application(s) --- zcutil/build-mac-cross.sh | 2 +- zcutil/build-mac.sh | 2 +- zcutil/build-no-qt.sh | 2 +- zcutil/build-win.sh | 2 +- zcutil/build.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zcutil/build-mac-cross.sh b/zcutil/build-mac-cross.sh index 36a09f71..9ff1d97e 100755 --- a/zcutil/build-mac-cross.sh +++ b/zcutil/build-mac-cross.sh @@ -23,4 +23,4 @@ LDFLAGS="-Wl,-no_pie" \ CXXFLAGS="-g0 -O2" \ CONFIG_SITE="$PWD/depends/x86_64-apple-darwin/share/config.site" ./configure --disable-tests --disable-bench --with-gui=qt5 --disable-bip70 # make app -make V=1 -j$(nproc --all) +make -j$(nproc --all) # V=1 diff --git a/zcutil/build-mac.sh b/zcutil/build-mac.sh index 5848b155..7e55bbbe 100755 --- a/zcutil/build-mac.sh +++ b/zcutil/build-mac.sh @@ -7,4 +7,4 @@ make -C ${PWD}/depends v=1 NO_PROTON=1 HOST=x86_64-apple-darwin -j$(nproc --all) # -Wno-deprecated-builtins -Wno-enum-constexpr-conversion CXXFLAGS="-g0 -O2 -Wno-unknown-warning-option" \ CONFIG_SITE="$PWD/depends/x86_64-apple-darwin/share/config.site" ./configure --disable-tests --disable-bench --with-gui=qt5 --disable-bip70 -make V=1 -j$(nproc --all) +make -j$(nproc --all) # V=1 diff --git a/zcutil/build-no-qt.sh b/zcutil/build-no-qt.sh index 2fa9f7e5..efc2a141 100755 --- a/zcutil/build-no-qt.sh +++ b/zcutil/build-no-qt.sh @@ -111,4 +111,4 @@ HOST="$HOST" BUILD="$BUILD" "$MAKE" "$@" -C ./depends/ V=1 NO_QT=1 #./makecustom #cd $WD -"$MAKE" "$@" V=1 +"$MAKE" "$@" # V=1 diff --git a/zcutil/build-win.sh b/zcutil/build-win.sh index 4bc5d8a5..6536e240 100755 --- a/zcutil/build-win.sh +++ b/zcutil/build-win.sh @@ -13,4 +13,4 @@ cd "$(dirname "$(readlink -f "$0")")/.." make "$@" -C ${PWD}/depends V=1 HOST=x86_64-w64-mingw32 ./autogen.sh CONFIG_SITE="$PWD/depends/x86_64-w64-mingw32/share/config.site" CXXFLAGS="-DCURL_STATICLIB -g0 -O2" ./configure --disable-tests --disable-bench --with-gui=qt5 --disable-bip70 -make "$@" V=1 +make "$@" # V=1 diff --git a/zcutil/build.sh b/zcutil/build.sh index b500bfd5..cf750e7a 100755 --- a/zcutil/build.sh +++ b/zcutil/build.sh @@ -111,4 +111,4 @@ HOST="$HOST" BUILD="$BUILD" "$MAKE" "$@" -C ./depends/ V=1 #./makecustom #cd $WD -"$MAKE" "$@" V=1 +"$MAKE" "$@" # V=1 From c93ce4d46863fb2a6ed4424af26ebb0042fa068a Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 20:48:54 +0100 Subject: [PATCH 14/15] build, libcryptoconditions_core: enable silent rules by default AM_DEFAULT_VERBOSITY is set to 0 by default. --- src/cryptoconditions/configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cryptoconditions/configure.ac b/src/cryptoconditions/configure.ac index 3749cee1..a833e647 100644 --- a/src/cryptoconditions/configure.ac +++ b/src/cryptoconditions/configure.ac @@ -8,6 +8,10 @@ AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_SUBDIRS([src/include/secp256k1]) AM_INIT_AUTOMAKE([foreign subdir-objects]) + +dnl make the compilation flags quiet unless V=1 is used +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + LT_INIT # Checks for programs. From f0bf588684f8e4859e434a58646663ccbfca67af Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Tue, 12 Mar 2024 20:51:11 +0100 Subject: [PATCH 15/15] build, qt: disable flags debug output --- src/Makefile.qt.include | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 4a8c765b..e1dc9c30 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -452,8 +452,8 @@ qt_komodo_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif if ENABLE_WALLET -$(info $(red)[ Decker ]$(reset) ENABLE_WALLET) -$(info $$EXTRA_LIBRARIES is [${EXTRA_LIBRARIES}]) +# $(info $(red)[ Decker ]$(reset) ENABLE_WALLET) +# $(info $$EXTRA_LIBRARIES is [${EXTRA_LIBRARIES}]) # LIBBITCOIN_CLI should be first? qt_komodo_qt_LDADD += libbitcoin_wallet.a endif @@ -502,15 +502,15 @@ if TARGET_DARWIN qt_komodo_qt_LDADD += -lc++ endif -$(info $(red)[ Decker ]$(reset) Check the komodo-qt dependencies ...) -#$(info $$qt_komodo_qt_CXXFLAGS is [${qt_komodo_qt_CXXFLAGS}]) -$(info $$qt_komodo_qt_CPPFLAGS is [${qt_komodo_qt_CPPFLAGS}]) -$(info $$qt_komodo_qt_LDADD is [${qt_komodo_qt_LDADD}]) -$(info $$qt_komodo_qt_LDFLAGS is [${qt_komodo_qt_LDFLAGS}]) -$(info $(red)[ Decker ]$(reset) Check the komodod dependencies ...) -$(info $$komodod_CPPFLAGS is [${komodod_CPPFLAGS}]) -$(info $$komodod_LDADD is [${komodod_LDADD}]) -$(info $$komodod_LDFLAGS is [${komodod_LDFLAGS}]) +# $(info $(red)[ Decker ]$(reset) Check the komodo-qt dependencies ...) +# #$(info $$qt_komodo_qt_CXXFLAGS is [${qt_komodo_qt_CXXFLAGS}]) +# $(info $$qt_komodo_qt_CPPFLAGS is [${qt_komodo_qt_CPPFLAGS}]) +# $(info $$qt_komodo_qt_LDADD is [${qt_komodo_qt_LDADD}]) +# $(info $$qt_komodo_qt_LDFLAGS is [${qt_komodo_qt_LDFLAGS}]) +# $(info $(red)[ Decker ]$(reset) Check the komodod dependencies ...) +# $(info $$komodod_CPPFLAGS is [${komodod_CPPFLAGS}]) +# $(info $$komodod_LDADD is [${komodod_LDADD}]) +# $(info $$komodod_LDFLAGS is [${komodod_LDFLAGS}]) # $(info $(red)$$QT_LIBS$(reset) is [${QT_LIBS}]) # $(info $(red)$$QT_DBUS_LIBS$(reset) is [${QT_DBUS_LIBS}])