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>
This commit is contained in:
Berthold Stoeger 2019-09-21 14:35:24 +02:00 committed by Dirk Hohndel
parent 4b401eb2de
commit 4f0582ea0b
2 changed files with 12 additions and 0 deletions

View file

@ -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
---

View file

@ -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);