|
|
|
@ -172,13 +172,15 @@ void MainWindow::processHighscore() {
|
|
|
|
|
|
|
|
|
|
QTextStream hs(&highscoreCSV);
|
|
|
|
|
for (auto key = highscore.keyValueBegin(); key != highscore.keyValueEnd(); key++){
|
|
|
|
|
hs << key->first.first << ";" << key->first.second.toString(Qt::DateFormat::ISODate) << ";" << key->second << "\n";
|
|
|
|
|
hs << key->first.first << ";" << key->first.second.toString(Qt::DateFormat::ISODate) << ";" << key->second << Qt::endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
highscoreCSV.close();
|
|
|
|
|
usleep(500); // paranoia
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::readHighscore() {
|
|
|
|
|
highscore.clear();
|
|
|
|
|
QDir appdata = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
|
|
|
|
QFile highscoreCSV = QFile(appdata.filePath(csv_name));
|
|
|
|
|
if (!appdata.exists()) {
|
|
|
|
|