This commit is contained in:
Max-Wilhelm Bruker 2009-11-30 19:33:45 +01:00
parent 55482246dd
commit 59e9416f57
29 changed files with 332 additions and 187 deletions

View file

@ -32,7 +32,7 @@ Client::~Client()
void Client::slotSocketError(QAbstractSocket::SocketError /*error*/)
{
emit logSocketError(socket->errorString());
emit socketError(socket->errorString());
disconnectFromServer();
}
@ -48,7 +48,7 @@ void Client::loginResponse(ResponseCode response)
setStatus(StatusLoggedIn);
else {
emit serverError(response);
disconnectFromServer();
setStatus(StatusDisconnecting);
}
}
@ -82,10 +82,13 @@ void Client::readData()
connect(cmdLogin, SIGNAL(finished(ResponseCode)), this, SLOT(loginResponse(ResponseCode)));
sendCommand(cmdLogin);
topLevelItem->read(xmlReader);
if (topLevelItem)
topLevelItem->read(xmlReader);
}
}
}
if (status == StatusDisconnecting)
disconnectFromServer();
}
void Client::processProtocolItem(ProtocolItem *item)
@ -96,10 +99,9 @@ void Client::processProtocolItem(ProtocolItem *item)
if (!cmd)
return;
pendingCommands.remove(cmd->getCmdId());
cmd->processResponse(response);
delete response;
pendingCommands.remove(cmd->getCmdId());
delete cmd;
return;