|
|
@ -172,13 +172,15 @@ void MainWindow::processHighscore() {
|
|
|
|
|
|
|
|
|
|
|
|
QTextStream hs(&highscoreCSV);
|
|
|
|
QTextStream hs(&highscoreCSV);
|
|
|
|
for (auto key = highscore.keyValueBegin(); key != highscore.keyValueEnd(); key++){
|
|
|
|
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();
|
|
|
|
highscoreCSV.close();
|
|
|
|
|
|
|
|
usleep(500); // paranoia
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::readHighscore() {
|
|
|
|
void MainWindow::readHighscore() {
|
|
|
|
|
|
|
|
highscore.clear();
|
|
|
|
QDir appdata = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
|
|
|
QDir appdata = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
|
|
|
QFile highscoreCSV = QFile(appdata.filePath(csv_name));
|
|
|
|
QFile highscoreCSV = QFile(appdata.filePath(csv_name));
|
|
|
|
if (!appdata.exists()) {
|
|
|
|
if (!appdata.exists()) {
|
|
|
|