mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Give QApplication dummy arguments
QApplication takes the command line arguments and parses them itself
for some built in command line arguments that it has. We don't want
any of those built in arguments, so instead give it dummy arguments.
Github-Pull: #16578
Rebased-From: a2714a5c69
This commit is contained in:
parent
9d389d09ed
commit
56815e9e12
3 changed files with 8 additions and 5 deletions
|
@ -173,8 +173,11 @@ void BitcoinCore::shutdown()
|
|||
}
|
||||
}
|
||||
|
||||
BitcoinApplication::BitcoinApplication(interfaces::Node& node, int &argc, char **argv):
|
||||
QApplication(argc, argv),
|
||||
static int qt_argc = 1;
|
||||
static const char* qt_argv = "bitcoin-qt";
|
||||
|
||||
BitcoinApplication::BitcoinApplication(interfaces::Node& node):
|
||||
QApplication(qt_argc, const_cast<char **>(&qt_argv)),
|
||||
coreThread(nullptr),
|
||||
m_node(node),
|
||||
optionsModel(nullptr),
|
||||
|
@ -446,7 +449,7 @@ int GuiMain(int argc, char* argv[])
|
|||
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||
#endif
|
||||
|
||||
BitcoinApplication app(*node, argc, argv);
|
||||
BitcoinApplication app(*node);
|
||||
|
||||
// Register meta types used for QMetaObject::invokeMethod
|
||||
qRegisterMetaType< bool* >();
|
||||
|
|
|
@ -57,7 +57,7 @@ class BitcoinApplication: public QApplication
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BitcoinApplication(interfaces::Node& node, int &argc, char **argv);
|
||||
explicit BitcoinApplication(interfaces::Node& node);
|
||||
~BitcoinApplication();
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
|
|
|
@ -71,7 +71,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
// Don't remove this, it's needed to access
|
||||
// QApplication:: and QCoreApplication:: in the tests
|
||||
BitcoinApplication app(*node, argc, argv);
|
||||
BitcoinApplication app(*node);
|
||||
app.setApplicationName("Bitcoin-Qt-test");
|
||||
|
||||
SSL_library_init();
|
||||
|
|
Loading…
Add table
Reference in a new issue