implement close log in log.cpp again

This commit is contained in:
doitux
2010-07-13 20:55:01 +00:00
parent bebc215e88
commit 7213e10ba8
3 changed files with 168 additions and 164 deletions
+3 -3
View File
@@ -46,14 +46,14 @@ CleanerServer::~CleanerServer()
} }
void CleanerServer::newCon() void CleanerServer::newCon()
{ {
if(!blockConnection) { if(!blockConnection) {
tcpSocket = tcpServer->nextPendingConnection(); tcpSocket = tcpServer->nextPendingConnection();
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onRead())); connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onRead()));
connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState))); connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
blockConnection = true; blockConnection = true;
} }
} }
void CleanerServer::onRead() void CleanerServer::onRead()
{ {
@@ -91,7 +91,7 @@ void CleanerServer::onRead()
tcpSocket->close(); tcpSocket->close();
} }
/* char buf[1024]; /* char buf[1024];
tcpSocket->readLine(buf, sizeof(buf)); tcpSocket->readLine(buf, sizeof(buf));
QString message = QString::fromUtf8("%1").arg(buf); QString message = QString::fromUtf8("%1").arg(buf);
+9 -5
View File
@@ -197,11 +197,7 @@ Log::Log(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(0), my
Log::~Log() Log::~Log()
{ {
qDebug() << "close log"; cerr << "log destruktor";
// Datenbank schließe
mySqliteLogDb->close();
delete myConfig; delete myConfig;
delete myLogDir; delete myLogDir;
delete myHtmlLogFile; delete myHtmlLogFile;
@@ -210,6 +206,14 @@ qDebug() << "close log";
myConfig = 0; myConfig = 0;
} }
void Log::closeLogDbAtExit()
{
// Datenbank schließen
mySqliteLogDb->close();
delete mySqliteLogDb;
mySqliteLogDb = NULL;
}
void Log::logPlayerActionMsg(QString msg, int playerID, int action, int setValue) { void Log::logPlayerActionMsg(QString msg, int playerID, int action, int setValue) {
switch (action) { switch (action) {
+13 -13
View File
@@ -176,19 +176,19 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
startWindowImpl::~startWindowImpl() startWindowImpl::~startWindowImpl()
{ {
delete myNewGameDialog; // delete myNewGameDialog;
delete mySelectAvatarDialog; // delete mySelectAvatarDialog;
delete mySettingsDialog; // delete mySettingsDialog;
delete myChangeHumanPlayerNameDialog; // delete myChangeHumanPlayerNameDialog;
delete myJoinNetworkGameDialog; // delete myJoinNetworkGameDialog;
delete myConnectToServerDialog; // delete myConnectToServerDialog;
delete myStartNetworkGameDialog; // delete myStartNetworkGameDialog;
delete myCreateNetworkGameDialog; // delete myCreateNetworkGameDialog;
delete myAboutPokerthDialog; // delete myAboutPokerthDialog;
delete myGameLobbyDialog; // delete myGameLobbyDialog;
delete myTimeoutDialog; // delete myTimeoutDialog;
delete myServerListDialog; // delete myServerListDialog;
delete myInternetGameLoginDialog; // delete myInternetGameLoginDialog;
} }
void startWindowImpl::callNewGameDialog() { void startWindowImpl::callNewGameDialog() {