X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=formations.cpp;h=a23469b9e21c7df044ac5d3c912f0b49533c8720;hb=51f84ab86d5bceb0de58f5d87b0af20ec31cce1c;hp=55e6de8c95f7d0429c8ff79bd19e6c109c1bb914;hpb=98adfa69244097657696e8e183331ebfa1d47205;p=pkanalytics 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;