Skip to content

Commit bd10162

Browse files
committed
Merge #41: Revert a commit from #5 to avoid merge conflict with bitcoin/bitcoin#22219
498a318 Revert 8efd330 (Hennadii Stepanov) Pull request description: This PR reverts the _"refactor: Move qwidget and qml common code into the main() function"_ commit (8efd330) from #5, and it allows to sync with the main repo without a merge conflict with bitcoin/bitcoin#22219. ACKs for top commit: promag: Tested ACK 498a318, a clean merge is possible after this. Tree-SHA512: b1d3708a20f36b81225a3c25963dbc32c3a33e54a795184cfea5b4af9c98ecd68cee8d297e94cced3f118aed738bafd4312536d62a445d09626d7fad613a2323
2 parents c749ffb + 498a318 commit bd10162

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/qml/bitcoin.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
#include <qt/guiutil.h>
1717
#include <qt/initexecutor.h>
1818
#include <util/system.h>
19+
#include <util/threadnames.h>
1920
#include <util/translation.h>
2021

2122
#include <boost/signals2/connection.hpp>
2223
#include <memory>
24+
#include <tuple>
2325

2426
#include <QDebug>
2527
#include <QGuiApplication>
@@ -84,6 +86,14 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
8486

8587
int QmlGuiMain(int argc, char* argv[])
8688
{
89+
#ifdef WIN32
90+
util::WinCmdLineArgs winArgs;
91+
std::tie(argc, argv) = winArgs.get();
92+
#endif // WIN32
93+
94+
SetupEnvironment();
95+
util::ThreadSetInternalName("main");
96+
8797
Q_INIT_RESOURCE(bitcoin_qml);
8898

8999
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

src/qt/bitcoin.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,13 @@ static void SetupUIArgs(ArgsManager& argsman)
451451

452452
int GuiMain(int argc, char* argv[])
453453
{
454+
#ifdef WIN32
455+
util::WinCmdLineArgs winArgs;
456+
std::tie(argc, argv) = winArgs.get();
457+
#endif
458+
SetupEnvironment();
459+
util::ThreadSetInternalName("main");
460+
454461
NodeContext node_context;
455462
std::unique_ptr<interfaces::Node> node = interfaces::MakeNode(&node_context);
456463

src/qt/main.cpp

-11
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414

1515
#include <interfaces/node.h>
1616
#include <noui.h>
17-
#include <util/system.h>
18-
#include <util/threadnames.h>
1917
#include <util/translation.h>
2018
#include <util/url.h>
2119

2220
#include <QCoreApplication>
2321

2422
#include <functional>
2523
#include <string>
26-
#include <tuple>
2724

2825
#if defined(QT_STATICPLUGIN)
2926
#include <QtPlugin>
@@ -46,14 +43,6 @@ int main(int argc, char* argv[])
4643
{
4744
qRegisterMetaType<interfaces::BlockAndHeaderTipInfo>("interfaces::BlockAndHeaderTipInfo");
4845

49-
#ifdef WIN32
50-
util::WinCmdLineArgs win_args;
51-
std::tie(argc, argv) = win_args.get();
52-
#endif // WIN32
53-
54-
SetupEnvironment();
55-
util::ThreadSetInternalName("main");
56-
5746
// Subscribe to global signals from core.
5847
noui_connect();
5948

0 commit comments

Comments
 (0)