cmake: Autogenerate most of the .qrc resource files
[quassel.git] / src / client / coreconnection.cpp
index e916d7f..4127152 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2016 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -184,6 +184,15 @@ void CoreConnection::onlineStateChanged(bool isOnline)
 }
 
 
+QPointer<Peer> CoreConnection::peer() const
+{
+    if (_peer) {
+        return _peer;
+    }
+    return _authHandler ? _authHandler->peer() : nullptr;
+}
+
+
 bool CoreConnection::isEncrypted() const
 {
     return _peer && _peer->isSecure();
@@ -372,14 +381,13 @@ void CoreConnection::connectToCurrentAccount()
             qWarning() << "Cannot connect to internal core in client-only mode!";
             return;
         }
-        emit startInternalCore();
 
         InternalPeer *peer = new InternalPeer();
         _peer = peer;
         Client::instance()->signalProxy()->addPeer(peer); // sigproxy will take ownership
+        emit connectionMsg(tr("Initializing..."));
         emit connectToInternalCore(peer);
         setState(Connected);
-
         return;
     }
 
@@ -395,7 +403,7 @@ void CoreConnection::connectToCurrentAccount()
     connect(_authHandler, SIGNAL(errorPopup(QString)), SIGNAL(connectionErrorPopup(QString)), Qt::QueuedConnection);
     connect(_authHandler, SIGNAL(statusMessage(QString)), SIGNAL(connectionMsg(QString)));
     connect(_authHandler, SIGNAL(encrypted(bool)), SIGNAL(encrypted(bool)));
-    connect(_authHandler, SIGNAL(startCoreSetup(QVariantList)), SIGNAL(startCoreSetup(QVariantList)));
+    connect(_authHandler, SIGNAL(startCoreSetup(QVariantList, QVariantList)), SIGNAL(startCoreSetup(QVariantList, QVariantList)));
     connect(_authHandler, SIGNAL(coreSetupFailed(QString)), SIGNAL(coreSetupFailed(QString)));
     connect(_authHandler, SIGNAL(coreSetupSuccessful()), SIGNAL(coreSetupSuccess()));
     connect(_authHandler, SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)), SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)));
@@ -463,9 +471,6 @@ void CoreConnection::onHandshakeComplete(RemotePeer *peer, const Protocol::Sessi
 void CoreConnection::internalSessionStateReceived(const Protocol::SessionState &sessionState)
 {
     updateProgress(100, 100);
-
-    Client::setCoreFeatures(Quassel::features()); // mono connection...
-
     setState(Synchronizing);
     syncToCore(sessionState);
 }