+MonolithicApplication::MonolithicApplication(int &argc, char **argv)
+ : QtUiApplication(argc, argv)
+{
+#if defined(HAVE_KDE4) || defined(Q_OS_MAC)
+ Quassel::disableCrashHandler();
+#endif /* HAVE_KDE4 || Q_OS_MAC */
+
+ Quassel::setRunMode(Quassel::Monolithic);
+}
+
+
+bool MonolithicApplication::init()
+{
+ if (!QtUiApplication::init())
+ return false;
+
+ connect(Client::coreConnection(), SIGNAL(connectToInternalCore(QPointer<InternalPeer>)), this, SLOT(onConnectionRequest(QPointer<InternalPeer>)));
+
+ // If port is set, start internal core directly so external clients can connect
+ // This is useful in case the mono client re-gains remote connection capability,
+ // in which case the internal core would not have to be started by default.
+ if (Quassel::isOptionSet("port")) {
+ startInternalCore();
+ }
+
+ return true;
+}
+
+
+MonolithicApplication::~MonolithicApplication()
+{
+ // Client needs to be destroyed first
+ Client::destroy();
+ _coreThread.quit();
+ _coreThread.wait();
+ Quassel::destroy();