From: Steinar H. Gunderson Date: Sun, 23 Jul 2023 12:58:33 +0000 (+0200) Subject: Write .json on quit, not start. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=971d4957bed4eba223b0ace948cfb5f991e0847f;p=pkanalytics Write .json on quit, not start. --- diff --git a/main.cpp b/main.cpp index c2d6cd3..6ca5ecd 100644 --- a/main.cpp +++ b/main.cpp @@ -147,9 +147,6 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); sqlite3 *db = open_db("ultimate.db"); - // TODO: do this on-demand instead, from a menu - export_to_json(db, "ultimate.json"); - int requested_match = -1; if (argc >= 2) { requested_match = atoi(argv[1]); @@ -166,6 +163,10 @@ int main(int argc, char *argv[]) mainWindow.resize(QSize(1280, 720)); mainWindow.show(); - return app.exec(); + int ret = app.exec(); + + // TODO: do this on-demand instead, from a menu + export_to_json(db, "ultimate.json"); + return ret; }