]> git.sesse.net Git - pkanalytics/commitdiff
Write .json on quit, not start.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Jul 2023 12:58:33 +0000 (14:58 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Jul 2023 12:58:33 +0000 (14:58 +0200)
main.cpp

index c2d6cd307382440281b75687c082c06ab7749d4f..6ca5ecdce930bd484ecba1486fd582e3d398d3c8 100644 (file)
--- 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;
 }