- // TODO clear internal data
-}
-
-void Client::coreConnected() {
- syncToCore();
-
-}
-
-void Client::coreDisconnected() {
+ /* Clear internal data. Hopefully nothing relies on it at this point. */
+ coreConnectionInfo.clear();
+ sessionData.clear();
+ //foreach(Buffer *buf, buffers.values()) delete buf;
+ qDebug() << "barfoo";
+ _bufferModel->clear();
+ //qDeleteAll(buffers);
+ qDebug() << "foobar";
+}
+
+void Client::coreSocketConnected() {
+ connect(this, SIGNAL(recvPartialItem(quint32, quint32)), this, SIGNAL(coreConnectionProgress(uint, uint)));
+ emit coreConnectionMsg(tr("Synchronizing to core..."));
+ VarMap clientInit;
+ clientInit["GuiProtocol"] = GUI_PROTOCOL;
+ clientInit["User"] = coreConnectionInfo["User"].toString();
+ clientInit["Password"] = coreConnectionInfo["Password"].toString();
+ writeDataToDevice(&socket, clientInit);
+}
+
+void Client::coreSocketDisconnected() {