Big update this time - Core has been redesigned to be multi-user capable. At least...
[quassel.git] / main / main_mono.cpp
index 87360c6..fdfb22f 100644 (file)
 
 int main(int argc, char **argv) {
   QApplication app(argc, argv);
-  QApplication::setOrganizationDomain("quassel-irc.org");
-  QApplication::setApplicationName("Quassel IRC");
-  QApplication::setOrganizationName("The Quassel Team");
+  QCoreApplication::setOrganizationDomain("quassel-irc.org");
+  QCoreApplication::setApplicationName("Quassel IRC");
+  QCoreApplication::setOrganizationName("Quassel IRC Development Team");
 
   Global::runMode = Global::Monolithic;
   Global::quasselDir = QDir::homePath() + "/.quassel";
 
   //settings = new Settings();
-  global = new Global();
+  //global = new Global();
   guiProxy = new GUIProxy();
-  coreProxy = new CoreProxy();
+  //coreProxy = new CoreProxy();
+  QObject::connect(Core::guiSession(), SIGNAL(proxySignal(CoreSignal, QVariant, QVariant, QVariant)), guiProxy, SLOT(recv(CoreSignal, QVariant, QVariant, QVariant)));
+  QObject::connect(guiProxy, SIGNAL(send(GUISignal, QVariant, QVariant, QVariant)), Core::guiSession(), SLOT(processSignal(GUISignal, QVariant, QVariant, QVariant)));
 
   Settings::init();
   Style::init();
@@ -53,33 +55,38 @@ int main(int argc, char **argv) {
   mainWin->show();
   mainWin->init();
   int exitCode = app.exec();
-  delete core;
+  //delete core;
+  Core::destroy();
   delete guiProxy;
-  delete coreProxy;
-  delete global;
+  //delete coreProxy;
+  //delete global;
   delete mainWin;
   //delete settings;
   return exitCode;
 }
 
 void MainWin::syncToCore() {
-  Q_ASSERT(global->getData("CoreReady").toBool());
-  coreBuffers = core->getBuffers();
+  //Q_ASSERT(Global::data("CoreReady").toBool());
+  coreBuffers = Core::guiSession()->buffers();
   // NOTE: We don't need to request server states, because in the monolithic version there can't be
   //       any servers connected at this stage...
 }
 
+/*
 void CoreProxy::sendToGUI(CoreSignal sig, QVariant arg1, QVariant arg2, QVariant arg3) {
   guiProxy->recv(sig, arg1, arg2, arg3);
 }
+*/
 
 GUIProxy::GUIProxy() {
-  if(guiProxy) qFatal("Trying to instantiate more than one CoreProxy object!");
+  if(guiProxy) qFatal("Trying to instantiate more than one GUIProxy object!");
 }
 
+/*
 void GUIProxy::send(GUISignal sig, QVariant arg1, QVariant arg2, QVariant arg3) {
   coreProxy->recv(sig, arg1, arg2, arg3);
 }
+*/
 
 // Dummy function definitions
 // These are not needed, since we don't have a network connection to the core.