Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
- db.setDatabaseName(savegamesPath+"pokecraft.db.sqlite");
- if(!db.open())
- {
- QMessageBox::critical(this,tr("Error"),QString("Unable to initialize the savegame (error: open database)"));
- rmpath(savegamesPath);
- return;
- }
- QSqlQuery sqlQuery=QString("DELETE FROM \"player\"");
- if(!sqlQuery.exec())
- {
- db.close();
- QMessageBox::critical(this,tr("Error"),QString("Unable to initialize the savegame (error: clean the table: %1)").arg(sqlQuery.lastError().text()));
- rmpath(savegamesPath);
- return;
- }
Add Comment
Please, Sign In to add comment