Cleanup: Remove global QFuture from exportFuncs

When exporting dives we show a message. The message is closed when
the export is finished. This is coordinated by a QFuture. Instead
of keeping a global QFuture in the export-code, pass it around
as a local variable.

This is supported according to Qt's documentation:
"QFuture is a lightweight reference counted class that can be
passed by value." and the source code indicates the same.

Not only does this remove a global, it also makes the code
more flexible: Now we could show one notification per export,
for example.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-06 22:18:42 +01:00 committed by Dirk Hohndel
parent 2cea115ddb
commit 5b302235f4
3 changed files with 7 additions and 7 deletions

View file

@ -16,9 +16,8 @@ public:
void export_TeX(const char *filename, const bool selected_only, bool plain);
void export_depths(const char *filename, const bool selected_only);
std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly);
void exportUsingStyleSheet(QString filename, bool doExport, int units,
QFuture<int> exportUsingStyleSheet(QString filename, bool doExport, int units,
QString stylesheet, bool anonymize);
QFuture<int> future;
// prepareDivesForUploadDiveLog
// prepareDivesForUploadDiveShare