mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-07 19:43:24 +00:00
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:
parent
4b401eb2de
commit
4f0582ea0b
2 changed files with 12 additions and 0 deletions
|
@ -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: 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
|
Mobile: try to adjust the UI for cases with large default font relative to screen size
|
||||||
---
|
---
|
||||||
|
|
|
@ -133,6 +133,17 @@ void DiveLogExportDialog::on_exportGroup_buttonClicked(QAbstractButton*)
|
||||||
static std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly)
|
static std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly)
|
||||||
{
|
{
|
||||||
std::vector<const dive_site *> res;
|
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);
|
res.reserve(dive_site_table.nr);
|
||||||
for (int i = 0; i < dive_site_table.nr; i++) {
|
for (int i = 0; i < dive_site_table.nr; i++) {
|
||||||
struct dive_site *ds = get_dive_site(i, &dive_site_table);
|
struct dive_site *ds = get_dive_site(i, &dive_site_table);
|
||||||
|
|
Loading…
Add table
Reference in a new issue