From 2102ab9f5cb542e6727e0f25e670d8549aa1bf1a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 5 Jan 2014 12:37:51 +0100 Subject: ui: Fix GUI initialization order Fixes at least #3478. Splits and documents the phases: 1. Parse command-line options. These take precedence over anything else. 2. Basic Qt initialization (not dependent on parameters or configuration) 3. Application identification 4. Initialization of translations 5. Now that settings and translations are available, ask user for data directory 6. Determine availability of data directory and parse bitcoin.conf 7. URI IPC sending 8. Main GUI initialization Splits command line parsing logic from ipcSendCommandLine into ipcParseCommandLine, as isTestNet() can only be overridden in the early stages before choosing a data directory. Sending however needs to happen after choosing a data directory. --- src/qt/paymentserver.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/qt/paymentserver.cpp') diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index ba5c06064f..3d6f5de754 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -180,10 +180,8 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store) // and the items in savedPaymentRequest will be handled // when uiReady() is called. // -bool PaymentServer::ipcSendCommandLine(int argc, char* argv[]) +bool PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { - bool fResult = false; - for (int i = 1; i < argc; i++) { QString arg(argv[i]); @@ -226,7 +224,18 @@ bool PaymentServer::ipcSendCommandLine(int argc, char* argv[]) qDebug() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg; } } + return true; +} +// +// Sending to the server is done synchronously, at startup. +// If the server isn't already running, startup continues, +// and the items in savedPaymentRequest will be handled +// when uiReady() is called. +// +bool PaymentServer::ipcSendCommandLine() +{ + bool fResult = false; foreach (const QString& r, savedPaymentRequests) { QLocalSocket* socket = new QLocalSocket(); -- cgit v1.2.3