aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/divecomputerextradatamodel.cpp
AgeCommit message (Collapse)Author
2020-10-25cleanup: split out divecomputer functions from dive.cGravatar Berthold Stoeger
Since dive.c is so huge, split out divecomputer-related functions into divecomputer.[c|h], sample.[c|h] and extradata.[c|h]. This does not give huge compile time improvements, since struct dive contains a struct divecomputer and therefore dive.h has to include divecomputer.h. However, it make things distinctly more clear. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-07cleanup: generalize ExtraDataModel to display data of any dcGravatar Berthold Stoeger
The goal here is to remove a dependency on displayed_dive. While doing so, make the model more general and display any dc. Pass in the dc of the current dive instead of displayed dive, since all other tabs are already converted to show data of the current dive. The QStrings are cached since we generate them anyway, so we may just keep them. Thus, there is no danger of the dc becoming invalid. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-07cleanup: return directly in ExtraDataModel::data()Gravatar Berthold Stoeger
Instead of assigning to a ret variable and returning at the end of the function, return directly from the various switch branches. This is more idiomatic and consistent with the other models. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-07cleanup: use begin/endResetModel in ExtraDataModelGravatar Berthold Stoeger
As we do in most other models, use begin/endResetModel() to reset the model. This is distinctly less errorprone than the add/removeRows() version as we don't have to check for empty ranges, etc. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-21qt-models: Change Q_UNUSED to no parameter nameGravatar jan Iversen
C++ permits use of parameters without name, which signals unused Signed-off-by: Jan Iversen <jani@apache.org>
2017-04-29Add SPDX header to Qt modelsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08Silence warnings in Divecomputerextradatamodel.cppGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move ExtraDataModel to qt-modelsGravatar Tomaz Canabrava
Another attempt to make it easyer to create the mobile version. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>