Skip to content

Commit

Permalink
Fix: Failed assertions when creating new database
Browse files Browse the repository at this point in the history
For #213
  • Loading branch information
svetter committed Mar 12, 2024
1 parent 04854dd commit 5687b37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/comp_tables/composite_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ void CompositeTable::setUpdateImmediately(bool updateImmediately, QProgressDialo
*/
void CompositeTable::announceChanges(const QSet<const Column*>& affectedColumns, const QList<QPair<BufferRowIndex, bool>>& rowsAddedOrRemoved)
{
assert(bufferInitialized);
if (!bufferInitialized) return;

const bool rowChanges = !rowsAddedOrRemoved.isEmpty();
assert(!rowChanges || !affectedColumns.isEmpty());

Expand Down
4 changes: 1 addition & 3 deletions src/settings/project_settings_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,11 @@ void ProjectSettingsWindow::saveSettings()

db.beginChangingData();
db.hikersTable.addRow(*this, *newDefaultHiker);
db.projectSettings.defaultHiker.set(*this, newDefaultHiker->hikerID.asQVariant());
db.finishChangingData();
db.projectSettings.defaultHiker.set(*this, newDefaultHiker->hikerID.asQVariant());
}
else {
db.beginChangingData();
db.projectSettings.defaultHiker.set(*this, parseItemCombo(*defaultHikerCombo, selectableHikerIDs).asQVariant());
db.finishChangingData();
}
}

Expand Down

0 comments on commit 5687b37

Please sign in to comment.