summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelistview.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-25 14:42:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-26 19:27:03 -0700
commitf193c2ef08d0edb1f40b6011a205eb8603c6019b (patch)
tree3faddb9bfd5a2c9fe769af04b60ff8bc50a9fa12 /desktop-widgets/divelistview.cpp
parent1a0cf0bb4432d97c1f34d53b82631629bcb06b8b (diff)
downloadsubsurface-f193c2ef08d0edb1f40b6011a205eb8603c6019b.tar.gz
cleanup: fix deprecated QVector constructor
Annoyingly, the replacement has only been available since Qt 5.14. To make the code less messy, implement our own stdToQt conversion helper. Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/divelistview.cpp')
-rw-r--r--desktop-widgets/divelistview.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index 92638a336..f98b298f4 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -17,6 +17,7 @@
#include <QMessageBox>
#include <QHeaderView>
#include "commands/command.h"
+#include "commands/command_base.h"
#include "core/errorhelper.h"
#include "core/qthelper.h"
#include "core/trip.h"
@@ -645,7 +646,7 @@ void DiveListView::addDivesToTrip()
std::vector<dive *> dives = getDiveSelection();
if (!t || dives.empty())
return;
- Command::addDivesToTrip(QVector<dive *>::fromStdVector(dives), t);
+ Command::addDivesToTrip(stdToQt<dive *>(dives), t);
}
void DiveListView::renumberDives()
@@ -734,8 +735,8 @@ void DiveListView::addToTrip(int delta)
if (!trip || !d)
// no dive, no trip? get me out of here
return;
-
- Command::addDivesToTrip(QVector<dive *>::fromStdVector(getDiveSelection()), trip);
+ std::vector<dive *> dives = getDiveSelection();
+ Command::addDivesToTrip(stdToQt<dive *>(dives), trip);
}
void DiveListView::markDiveInvalid()
@@ -753,8 +754,7 @@ void DiveListView::deleteDive()
struct dive *d = contextMenuIndex.data(DiveTripModelBase::DIVE_ROLE).value<struct dive *>();
if (!d)
return;
-
- Command::deleteDive(QVector<dive *>::fromStdVector(getDiveSelection()));
+ Command::deleteDive(stdToQt<dive *>(getDiveSelection()));
}
void DiveListView::contextMenuEvent(QContextMenuEvent *event)