summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogexportdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/divelogexportdialog.cpp')
-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);