diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-09-21 14:35:24 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-09-21 16:07:24 -0700 |
commit | 4f0582ea0b19f044487588a8b1e68b645f4b28cb (patch) | |
tree | 9fcaf0c30c853101998a05849af04e693e67b1d4 | |
parent | 4b401eb2def0b90dd3958aa114d18621a14b7b9d (diff) | |
download | subsurface-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>
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | desktop-widgets/divelogexportdialog.cpp | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c0255b65..49d4654bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +Export: when exporting dive sites in dive site mode, export selected dive sites [#2275] Mobile: fix several bugs in the handling of incorrect or unverified cloud credentials Mobile: try to adjust the UI for cases with large default font relative to screen size --- 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); |