fix Qt Database error message when close the app

This commit is contained in:
doitux
2010-07-13 19:34:05 +00:00
parent b34dcdc597
commit 95da669f91
3 changed files with 5 additions and 9 deletions
+3 -6
View File
@@ -200,15 +200,12 @@ Log::~Log()
myConfig = 0;
}
bool Log::closeLogDb()
void Log::closeLogDbAtExit()
{
// Datenbank schließen
mySqliteLogDb->close();
*mySqliteLogDb = QSqlDatabase();
if(mySqliteLogDb->isOpen())
return FALSE;
else
return TRUE;
delete mySqliteLogDb;
mySqliteLogDb = NULL;
}
+1 -1
View File
@@ -41,7 +41,7 @@ public:
public slots:
bool closeLogDb();
void closeLogDbAtExit();
void logPlayerActionMsg(QString playerName, int playerID, int action, int setValue);
void logNewGameHandMsg(int gameID, int handID);
void logNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString bbName);
+1 -2
View File
@@ -941,10 +941,9 @@ QString startWindowImpl::checkForFirstStartAfterUpdated()
bool startWindowImpl::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::Close) {
event->ignore();
myGuiInterface->getMyLog()->closeLogDb();
myGuiInterface->getMyLog()->closeLogDbAtExit();
return QMainWindow::eventFilter(obj, event);
}
else {