adding categories works

This commit is contained in:
Martin Rotter 2022-03-07 09:44:36 +01:00
parent 2100573a14
commit 109b91c13d
2 changed files with 6 additions and 1 deletions

View File

@ -1950,7 +1950,7 @@ void DatabaseQueries::createOverwriteCategory(const QSqlDatabase& db, Category*
q.next();
int next_order = (q.value(0).isNull() ? 0 : q.value(0).toInt()) + 1;
int next_order = (q.value(0).isNull() ? -1 : q.value(0).toInt()) + 1;
category->setSortOrder(next_order);
q.finish();

View File

@ -110,6 +110,11 @@ void FormCategoryDetails::apply() {
m_serviceRoot->requestItemReassignment(m_category, parent);
m_serviceRoot->itemChanged({ m_category });
if (m_creatingNew) {
m_serviceRoot->requestItemExpand({ parent }, true);
}
accept();
}