@@ -178,8 +178,8 @@ public Q_SLOTS:
178
178
void shutdown ();
179
179
180
180
Q_SIGNALS:
181
- void initializeResult (int retval );
182
- void shutdownResult (int retval );
181
+ void initializeResult (bool success );
182
+ void shutdownResult ();
183
183
void runawayException (const QString &message);
184
184
185
185
private:
@@ -223,8 +223,8 @@ class BitcoinApplication: public QApplication
223
223
WId getMainWinId () const ;
224
224
225
225
public Q_SLOTS:
226
- void initializeResult (int retval );
227
- void shutdownResult (int retval );
226
+ void initializeResult (bool success );
227
+ void shutdownResult ();
228
228
// / Handle runaway exceptions. Shows a message box with the problem and quits the program.
229
229
void handleRunawayException (const QString &message);
230
230
@@ -284,7 +284,7 @@ void BitcoinCore::initialize()
284
284
Q_EMIT initializeResult (false );
285
285
return ;
286
286
}
287
- int rv = AppInitMain (threadGroup, scheduler);
287
+ bool rv = AppInitMain (threadGroup, scheduler);
288
288
Q_EMIT initializeResult (rv);
289
289
} catch (const std::exception& e) {
290
290
handleRunawayException (&e);
@@ -302,7 +302,7 @@ void BitcoinCore::shutdown()
302
302
threadGroup.join_all ();
303
303
Shutdown ();
304
304
qDebug () << __func__ << " : Shutdown finished" ;
305
- Q_EMIT shutdownResult (1 );
305
+ Q_EMIT shutdownResult ();
306
306
} catch (const std::exception& e) {
307
307
handleRunawayException (&e);
308
308
} catch (...) {
@@ -398,8 +398,8 @@ void BitcoinApplication::startThread()
398
398
executor->moveToThread (coreThread);
399
399
400
400
/* communication to and from thread */
401
- connect (executor, SIGNAL (initializeResult (int )), this , SLOT (initializeResult (int )));
402
- connect (executor, SIGNAL (shutdownResult (int )), this , SLOT (shutdownResult (int )));
401
+ connect (executor, SIGNAL (initializeResult (bool )), this , SLOT (initializeResult (bool )));
402
+ connect (executor, SIGNAL (shutdownResult ()), this , SLOT (shutdownResult ()));
403
403
connect (executor, SIGNAL (runawayException (QString)), this , SLOT (handleRunawayException (QString)));
404
404
connect (this , SIGNAL (requestedInitialize ()), executor, SLOT (initialize ()));
405
405
connect (this , SIGNAL (requestedShutdown ()), executor, SLOT (shutdown ()));
@@ -450,12 +450,12 @@ void BitcoinApplication::requestShutdown()
450
450
Q_EMIT requestedShutdown ();
451
451
}
452
452
453
- void BitcoinApplication::initializeResult (int retval )
453
+ void BitcoinApplication::initializeResult (bool success )
454
454
{
455
- qDebug () << __func__ << " : Initialization result: " << retval ;
456
- // Set exit result: 0 if successful, 1 if failure
457
- returnValue = retval ? 0 : 1 ;
458
- if (retval )
455
+ qDebug () << __func__ << " : Initialization result: " << success ;
456
+ // Set exit result.
457
+ returnValue = success ? EXIT_SUCCESS : EXIT_FAILURE ;
458
+ if (success )
459
459
{
460
460
// Log this only after AppInitMain finishes, as then logging setup is guaranteed complete
461
461
qWarning () << " Platform customization:" << platformStyle->getName ();
@@ -507,9 +507,8 @@ void BitcoinApplication::initializeResult(int retval)
507
507
}
508
508
}
509
509
510
- void BitcoinApplication::shutdownResult (int retval )
510
+ void BitcoinApplication::shutdownResult ()
511
511
{
512
- qDebug () << __func__ << " : Shutdown result: " << retval;
513
512
quit (); // Exit main loop after shutdown finished
514
513
}
515
514
0 commit comments