- if (Quassel::init()) {
- // Settings upgrade/downgrade handling
- if (!migrateSettings()) {
- qCritical() << "Could not load or upgrade client settings, terminating!";
- return false;
- }
-
- Client::init(new QtUi());
-
- // Init UI only after the event loop has started
- // TODO Qt5: Make this a lambda
- QTimer::singleShot(0, this, SLOT(initUi()));
-
- Quassel::registerQuitHandler([]() {
- QtUi::mainWindow()->quit();
- });
+ if (!Quassel::init()) {
+ throw ExitException{EXIT_FAILURE, tr("Could not initialize Quassel!")};
+ }