Commit graph

8 commits

Author SHA1 Message Date
Berthold Stoeger
8f0e2245c2 export: move exportProfile() function to exportfuncs.cpp
The exportProfile function uses the UI and therefore was
supposed to be declared in backend-shared/* but defined
separately for desktop and mobile. Currently, only the
desktop version exists.

The goal however should be that there is no need of the
UI for this function. In a first step, move the function
to the common backend-shared/* code and conditionally
compile for desktop. In upcoming commits, the function
will be made independent of the UI.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-12-17 11:54:23 -08:00
Berthold Stoeger
38d0fac2d1 export: show progress dialog for profile exports
Simply reuse QProgressDialog interface for the TeX exports.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-05-06 08:21:04 -07:00
Berthold Stoeger
9ee8807af7 export: show progress dialog for TeX exports
The TeX exports may hang the UI for a long time.

Show a progress-dialog that is updated after every exported dive
and allows the user to cancel the export.

This is pretty lame, because it is synchronous (export still runs
in UI thread) and therefore the UI still is sluggish. But it
is an improvement.

Since the TeX-exporting code is in a shared directory (desktop and
mobile), this uses a slim interface class. Mobile does not
yet use TeX export, but you never know. Better than #ifdefs
sprinkled all around, I reckon.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-05-06 08:21:04 -07:00
Berthold Stoeger
8391d926c7 Cleanup: remove const bool parameters and return types
These just make no sense. Since the value is copied, it
has no meaning to the caller whether the function can
change the value (and vice versa for return types).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-09 12:13:18 -08:00
Berthold Stoeger
ee839bf686 Cleanup: only use necessary includes in exportfuncs.h
Forward declare if possible.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-09 12:13:18 -08:00
Berthold Stoeger
2ec570098b Cleanup: remove exportFunc class
exportFunc was a collections of functions for exporting dive data.
It had no state, therefore there is no reason for it to ever be
instantiated.

Simply remove the class. Rename the saveProfile function to
exportProfile so that all export functions start with "export".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-09 12:13:18 -08:00
Berthold Stoeger
5b302235f4 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>
2020-02-09 12:13:18 -08:00
jan Iversen
9c52aaf043 build-system: move exportfuncs to backend-shared
WARNING: multi directory commit, needed to secure it builds.

move the core/exportfuncs.* to backend-shared.

update backend-shared/CMakeLists.txt to generate backend-shared lib

update CMakeLists.txt to include backend-shared lib in link process.

update ios project to reflect new directory

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 08:44:23 +09:00
Renamed from core/exportfuncs.h (Browse further)