mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: use dive * instead of unique index in renumber-dives
Now, that pointers to dives are stable, we might just as well use dive * instead of the unique-id. This also affects the merge-dive command, as this uses the same renumbering machinery. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
26901a8dbd
commit
96d8727399
5 changed files with 16 additions and 16 deletions
|
@ -161,14 +161,14 @@ void RenumberDialog::buttonClicked(QAbstractButton *button)
|
|||
if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) {
|
||||
MainWindow::instance()->dive_list()->rememberSelection();
|
||||
// we remember a list from dive uuid to a new number
|
||||
QVector<QPair<int, int>> renumberedDives;
|
||||
QVector<QPair<dive *, int>> renumberedDives;
|
||||
int i;
|
||||
int newNr = ui.spinBox->value();
|
||||
struct dive *dive = NULL;
|
||||
for_each_dive (i, dive) {
|
||||
if (!selectedOnly || dive->selected) {
|
||||
invalidate_dive_cache(dive);
|
||||
renumberedDives.append(QPair<int, int>(dive->id, newNr++));
|
||||
struct dive *d;
|
||||
for_each_dive (i, d) {
|
||||
if (!selectedOnly || d->selected) {
|
||||
invalidate_dive_cache(d);
|
||||
renumberedDives.append({ d, newNr++ });
|
||||
}
|
||||
}
|
||||
Command::renumberDives(renumberedDives);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue