fix Qt Database error message when close the app

This commit is contained in:
doitux
2010-07-13 19:13:38 +00:00
parent a78a9e80ea
commit b34dcdc597
8 changed files with 1724 additions and 1693 deletions
@@ -26,6 +26,7 @@
#include <net/socket_msg.h>
#include "tools.h"
#include "log.h"
#include "session.h"
#include "game.h"
#include "guiwrapper.h"
@@ -68,6 +69,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
// #endif
setupUi(this);
this->setWindowTitle(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
this->installEventFilter(this);
//Widgets Grafiken per Stylesheets setzen
QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
@@ -936,3 +938,17 @@ QString startWindowImpl::checkForFirstStartAfterUpdated()
return QString();
}
bool startWindowImpl::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::Close) {
event->ignore();
myGuiInterface->getMyLog()->closeLogDb();
return QMainWindow::eventFilter(obj, event);
}
else {
// pass the event on to the parent class
return QMainWindow::eventFilter(obj, event);
}
}