Skip to content

Commit

Permalink
Merge bitcoin#30567: qt, build: Drop QT_STATICPLUGIN macro
Browse files Browse the repository at this point in the history
7231c76 qt: Replace deprecated LogPrintf with LogInfo in GUIUtil::LogQtInfo() (Hennadii Stepanov)
b3d3ae0 qt, build: Drop `QT_STATICPLUGIN` macro (Hennadii Stepanov)

Pull request description:

  Broken out of bitcoin#30454.

  Our `QT_STATICPLUGIN` macro is effectively equivalent to the Qt's `QT_STATIC` macro.

  It is easy to see in the `_BITCOIN_QT_IS_STATIC` macro implementation: https://github.com/bitcoin/bitcoin/blob/ebd82fa9fae13d5a7a395800295dd7fd34185b58/build-aux/m4/bitcoin_qt.m4#L269-L292

  No need to handle both macros.

ACKs for top commit:
  maflcko:
    re-ACK 7231c76
  TheCharlatan:
    ACK 7231c76

Tree-SHA512: abbf21859b7ac2aaf47c5b0e075403e4cc9bc540b1565d23f51650b8932dde314586aca67fd4ed5daadebc89268baf8c18f65348fa2b836078ac24543c14cfd6
  • Loading branch information
fanquake authored and PastaPastaPasta committed Oct 3, 2024
1 parent 7c0d44c commit 5ba1309
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
1 change: 0 additions & 1 deletion build-aux/m4/bitcoin_qt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
fi
fi
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
if test "x$TARGET_OS" != xandroid; then
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal])
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include <QTimer>
#include <QTranslator>

#if defined(QT_STATICPLUGIN)
#if defined(QT_STATIC)
#include <QtPlugin>
#if defined(QT_QPA_PLATFORM_XCB)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
Expand Down
19 changes: 7 additions & 12 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1862,29 +1862,24 @@ void LogQtInfo()
#else
const std::string qt_link{"dynamic"};
#endif
#ifdef QT_STATICPLUGIN
const std::string plugin_link{"static"};
#else
const std::string plugin_link{"dynamic"};
#endif
LogPrintf("Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString(), plugin_link);
LogInfo("Qt %s (%s), plugin=%s\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString());
const auto static_plugins = QPluginLoader::staticPlugins();
if (static_plugins.empty()) {
LogPrintf("No static plugins.\n");
LogInfo("No static plugins.\n");
} else {
LogPrintf("Static plugins:\n");
LogInfo("Static plugins:\n");
for (const QStaticPlugin& p : static_plugins) {
QJsonObject meta_data = p.metaData();
const std::string plugin_class = meta_data.take(QString("className")).toString().toStdString();
const int plugin_version = meta_data.take(QString("version")).toInt();
LogPrintf(" %s, version %d\n", plugin_class, plugin_version);
LogInfo(" %s, version %d\n", plugin_class, plugin_version);
}
}

LogPrintf("Style: %s / %s\n", QApplication::style()->objectName().toStdString(), QApplication::style()->metaObject()->className());
LogPrintf("System: %s, %s\n", QSysInfo::prettyProductName().toStdString(), QSysInfo::buildAbi().toStdString());
LogInfo("Style: %s / %s\n", QApplication::style()->objectName().toStdString(), QApplication::style()->metaObject()->className());
LogInfo("System: %s, %s\n", QSysInfo::prettyProductName().toStdString(), QSysInfo::buildAbi().toStdString());
for (const QScreen* s : QGuiApplication::screens()) {
LogPrintf("Screen: %s %dx%d, pixel ratio=%.1f\n", s->name().toStdString(), s->size().width(), s->size().height(), s->devicePixelRatio());
LogInfo("Screen: %s %dx%d, pixel ratio=%.1f\n", s->name().toStdString(), s->size().width(), s->size().height(), s->devicePixelRatio());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/qt/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <QTest>
#include <functional>

#if defined(QT_STATICPLUGIN)
#if defined(QT_STATIC)
#include <QtPlugin>
#if defined(QT_QPA_PLATFORM_MINIMAL)
Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin);
Expand Down

0 comments on commit 5ba1309

Please sign in to comment.