From 4f0582ea0b19f044487588a8b1e68b645f4b28cb Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 21 Sep 2019 14:35:24 +0200 Subject: 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 --- desktop-widgets/divelogexportdialog.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'desktop-widgets') 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 getDiveSitesToExport(bool selectedOnly) { std::vector 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 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); -- cgit v1.2.3-70-g09d2