projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: Improve handling of core initialization errors
[quassel.git]
/
src
/
qtui
/
qtuiapplication.cpp
diff --git
a/src/qtui/qtuiapplication.cpp
b/src/qtui/qtuiapplication.cpp
index
c9475fe
..
20c1662
100644
(file)
--- a/
src/qtui/qtuiapplication.cpp
+++ b/
src/qtui/qtuiapplication.cpp
@@
-34,6
+34,7
@@
#include "mainwin.h"
#include "qtui.h"
#include "qtuisettings.h"
#include "mainwin.h"
#include "qtui.h"
#include "qtuisettings.h"
+#include "types.h"
QtUiApplication::QtUiApplication(int &argc, char **argv)
#ifdef HAVE_KDE4
QtUiApplication::QtUiApplication(int &argc, char **argv)
#ifdef HAVE_KDE4
@@
-98,28
+99,26
@@
QtUiApplication::QtUiApplication(int &argc, char **argv)
}
}
-
bool
QtUiApplication::init()
+
void
QtUiApplication::init()
{
{
- if (Quassel::init()) {
- // Settings upgrade/downgrade handling
- if (!migrateSettings()) {
- qCritical() << "Could not load or upgrade client settings, terminating!";
- return false;
- }
+ if (!Quassel::init()) {
+ throw ExitException{EXIT_FAILURE, tr("Could not initialize Quassel!")};
+ }
- Client::init(new QtUi());
+ // Settings upgrade/downgrade handling
+ if (!migrateSettings()) {
+ throw ExitException{EXIT_FAILURE, tr("Could not load or upgrade client settings!")};
+ }
- // Init UI only after the event loop has started
- // TODO Qt5: Make this a lambda
- QTimer::singleShot(0, this, SLOT(initUi()));
+ Client::init(new QtUi());
- Quassel::registerQuitHandler([]() {
- QtUi::mainWindow()->quit();
-
}
);
+ // Init UI only after the event loop has started
+ // TODO Qt5: Make this a lambda
+
QTimer::singleShot(0, this, SLOT(initUi())
);
- return true;
- }
-
return false
;
+ Quassel::registerQuitHandler([]() {
+ QtUi::mainWindow()->quit();
+
})
;
}
}