summaryrefslogtreecommitdiffstats
path: root/export-html.cpp
AgeCommit message (Collapse)Author
2018-10-07Statistics: remove global state / calculate only when neededGravatar Berthold Stoeger
Statistics were calculated into global variables every time the current dive was changed. Calculate statistics only when needed and into a structure provided by the caller. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-07Dive information: fix surface interval calculationGravatar Berthold Stoeger
The old surface interval calculation had fundamental issues: 1) process_all_dives(), which calculates the statistics over *all* dives was used to get the pointer to the previous dive. 2) If two dives in the table had the same time, one of those would have been considered the "previous" dive. 3) If the dive, for which the surface interval is calculated is not yet in the table, no previous dive would be determined. Fix all this by creating a get_surface_interval() function and removing the "get previous dive" functionality of process_all_dives(). Remove the process_all_dives() call from TabDiveInformation::updateData(). Reported-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-09Fix export-htmlGravatar Dirk Hohndel
In commit d815e0c947 ("Parse: pass dive_table argument to parse_file()") a syntax error was introduced and never caught since we don't test compile export-html on Travis. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-23Parse: pass dive_table argument to parse_file()Gravatar Berthold Stoeger
To enable undo of divelog-importing it is crucial that parse_file() can parse into arbitrary dive tables. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-30Cleanup: Make WindowsTitleUpdate a global objectGravatar Berthold Stoeger
WindowsTitleUpdate is such a trivial object (a QObject with a single signal and no own state), that it's not really understandable why it would need all that "singleton" boiler-plate. Just make it a default constructed/destructed global object. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-14Core: remove dive.h from files that don't need itGravatar Dirk Hohndel
Of course, quite a few of them indirectly get it through other header files. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to top level filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05Finish removal of informational_prefsGravatar Dirk Hohndel
And make export-html build again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02Move the qtTranslator and ssrfTranslator pointers to qt-init.cppGravatar Thiago Macieira
No point in having it defined in each main program's .cpp. Especially since the unit tests don't define them. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07export-html needs to actually calculate the statisticsGravatar Dirk Hohndel
Otherwise they will always be empty. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07Prevent crash in export-htmlGravatar Dirk Hohndel
We need to instantiate the window title updater... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Correctly copy preferencesGravatar Dirk Hohndel
When just assigning one structure to the other we copy the string pointers. If we then modify those strings in the copy, we happily free the strings of the original. And then resetting the preferences equally happily reused those strings, pointing to long since freed memory. I think what I did now is excessive for the current use case in that it copies a ton of strings that are unset in the default_prefs. But I figured this is a rarely used function and I might as well do it correctly. Also, once we implement multi user support with per user preferences we will be copying completely populated preferences around (at least that's my guess). Fixes #940 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18HTML standalone exporter: use Subsurface dive numbersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18HTML standalone exporter: give up if parsing the input failsGravatar Dirk Hohndel
There's no point in trying to export after not being able to read the data in the first place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17HTML standalone exporter: don't setup preferencesGravatar Dirk Hohndel
We don't need them and they can cause the application to crash when called in a git hook. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17Use saved units in the HTML exporterGravatar Dirk Hohndel
Also update the exporter to match the latest changes in the Subsurface code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Implement a standalone HTML exporterGravatar Dirk Hohndel
This is mostly a proof of concept right now; it shows that it is possible to create a headless server application that exports a git repository based data file as html. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>