From: Steinar H. Gunderson Date: Mon, 29 May 2023 13:32:01 +0000 (+0200) Subject: Fix sorting after inserting a new formation. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=51f84ab86d5bceb0de58f5d87b0af20ec31cce1c;p=pkanalytics Fix sorting after inserting a new formation. --- diff --git a/formations.cpp b/formations.cpp index 55e6de8..a23469b 100644 --- a/formations.cpp +++ b/formations.cpp @@ -70,12 +70,10 @@ unsigned FormationsModel::insert_new(const std::string &name) fprintf(stderr, "INSERT finalize: %s\n", sqlite3_errmsg(db)); abort(); } - - beginResetModel(); // Simplest for our use, though not ideal. - int formation_id = sqlite3_last_insert_rowid(db); - formations.push_back(Formation{ formation_id, name }); + beginResetModel(); // Simplest for our use, though not ideal. + load_data(); endResetModel(); return formation_id;