From 971d4957bed4eba223b0ace948cfb5f991e0847f Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 23 Jul 2023 14:58:33 +0200 Subject: [PATCH] Write .json on quit, not start. --- main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } -- 2.39.2