summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-21 14:35:24 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-09-21 16:07:24 -0700
commit4f0582ea0b19f044487588a8b1e68b645f4b28cb (patch)
tree9fcaf0c30c853101998a05849af04e693e67b1d4 /desktop-widgets
parent4b401eb2def0b90dd3958aa114d18621a14b7b9d (diff)
downloadsubsurface-4f0582ea0b19f044487588a8b1e68b645f4b28cb.tar.gz
Export: special case dive site mode when exporting dive sites
In dive site mode, export selected dive sites, not dive sites of selected dives. Fixes #2275. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/divelogexportdialog.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp
index 2b1409aea..e44f2280d 100644
--- a/desktop-widgets/divelogexportdialog.cpp
+++ b/desktop-widgets/divelogexportdialog.cpp
@@ -133,6 +133,17 @@ void DiveLogExportDialog::on_exportGroup_buttonClicked(QAbstractButton*)
static std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly)
{
std::vector<const dive_site *> res;
+
+ if (selectedOnly && MultiFilterSortModel::instance()->diveSiteMode()) {
+ // Special case in dive site mode: export all selected dive sites,
+ // not the dive sites of selected dives.
+ QVector<dive_site *> sites = MultiFilterSortModel::instance()->filteredDiveSites();
+ res.reserve(sites.size());
+ for (const dive_site *ds: sites)
+ res.push_back(ds);
+ return res;
+ }
+
res.reserve(dive_site_table.nr);
for (int i = 0; i < dive_site_table.nr; i++) {
struct dive_site *ds = get_dive_site(i, &dive_site_table);