Skip to content

Commit

Permalink
Hotfix: Failed assertion when editing photos in ascent viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
svetter committed Mar 13, 2024
1 parent 477e3fe commit 1392397
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/db/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ void Table::updateRowInNormalTable(QWidget& parent, const ValidItemID primaryKey
const QVariant currentValue = buffer.getCell(bufferIndex, column->getIndex());
if (currentValue == newValue) columnDataPairs.remove(i);
}
if (columnDataPairs.isEmpty()) return;

updateRowsInNormalTable(parent, { bufferIndex }, columnDataPairs);
}
Expand Down
4 changes: 4 additions & 0 deletions src/viewer/ascent_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,9 @@ void AscentViewer::savePhotosList()
for (int i = 0; i < photos.size(); i++) {
photos[0].sortIndex = i;
}
db.beginChangingData();
db.photosTable.updateRows(*this, FORCE_VALID(currentAscentID), photos);
db.finishChangingData();
}


Expand All @@ -849,7 +851,9 @@ void AscentViewer::saveDescription()
QString newDescription = descriptionTextBrowser->toPlainText();
bool descriptionChanged = db.ascentsTable.descriptionColumn.getValueFor(FORCE_VALID(currentAscentID)) != newDescription;
if (descriptionChanged) {
db.beginChangingData();
db.ascentsTable.updateCell(*this, FORCE_VALID(currentAscentID), db.ascentsTable.descriptionColumn, newDescription);
db.finishChangingData();
}
}

Expand Down

0 comments on commit 1392397

Please sign in to comment.