Fixes #410 - away log (you'll find it in the views menu)
[quassel.git] / src / core / core.cpp
index 38272e3..4e7632f 100644 (file)
@@ -18,8 +18,6 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#include <QMetaObject>
-#include <QMetaMethod>
 #include <QCoreApplication>
 
 #include "core.h"
@@ -53,7 +51,7 @@ void Core::destroy() {
 Core::Core() : storage(0) {
   _startTime = QDateTime::currentDateTime().toUTC();  // for uptime :)
 
-  loadTranslation(QLocale::system());
+  Quassel::loadTranslation(QLocale::system());
 
   // FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
   // Move settings, note this does not delete the old files
@@ -72,7 +70,6 @@ Core::Core() : storage(0) {
 #endif /* Q_WS_MAC */
 
   if(newSettings.value("Config/Version").toUInt() == 0) {
-    qWarning() << "\n\n*** IMPORTANT: Config and data file locations have changed. Attempting to auto-migrate your core settings...";
 #   ifdef Q_WS_MAC
     QString org = "quassel-irc.org";
 #   else
@@ -80,10 +77,11 @@ Core::Core() : storage(0) {
 #   endif
     QSettings oldSettings(org, "Quassel Core");
     if(oldSettings.allKeys().count()) {
+      qWarning() << "\n\n*** IMPORTANT: Config and data file locations have changed. Attempting to auto-migrate your core settings...";
       foreach(QString key, oldSettings.allKeys())
         newSettings.setValue(key, oldSettings.value(key));
       newSettings.setValue("Config/Version", 1);
-      qWarning() << "*   Your core settings have been migrated to" << newFilePath;
+      qWarning() << "*   Your core settings have been migrated to" << newSettings.fileName();
 
 #ifndef Q_WS_MAC /* we don't need to move the db and cert for mac */
 #ifdef Q_OS_WIN32
@@ -116,10 +114,10 @@ Core::Core() : storage(0) {
         else
           qWarning() << "!!! Moving your certificate has failed. Please move it manually into" << Quassel::configDirPath();
       }
+#endif /* !Q_WS_MAC */
       qWarning() << "*** Migration completed.\n\n";
     }
   }
-#endif /* !Q_WS_MAC */
   // MIGRATION end
 
   // check settings version
@@ -160,10 +158,21 @@ void Core::init() {
 }
 
 Core::~Core() {
+  _server.close();
+  _v6server.close();
   foreach(QTcpSocket *socket, blocksizes.keys()) {
     socket->disconnectFromHost();  // disconnect non authed clients
   }
-  qDeleteAll(sessions);
+
+  
+  foreach(SessionThread *session, sessions) {
+    session->stopSession();
+    session->wait();
+    delete session;
+    qDebug() << "next";
+  }
+
+//   qDeleteAll(sessions);
   qDeleteAll(_storageBackends);
 }