aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-10-27cleanup: refactor subsurfacesysinfo.cppGravatar Berthold Stoeger
This used to be a copy of QSysInfo. However, once the requirement was raised to Qt5.4, this was replaced by a subclass of the original QSysInfo - which made the whole file mostly obsolete. Just use QSysInfo directly where needed. Only for windows.c, which can't call directly into Qt, keep the isWin7Or8() helper function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-26desktop: move MinMaxAvgWidget to TabDiveStatisticsGravatar Berthold Stoeger
This is its only user and the widget is scheduled for removal. Let's move it there temporarilly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-26cleanup: remove dive.h include in simplewidgets.hGravatar Berthold Stoeger
Let's simply forward declare the needed structures. Also removes removes two more unnecessary includes. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-26tests: don't fail if TestGitStorage can reach the serverGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26build-system: use openSUSE Tumbleweed latestGravatar Dirk Hohndel
Without a distro update, Leap 15.2 appears to only give us Qt 5.12. Since the upgrade takes forever and causes problems as it requests a senseless 'reboot' of the container, let's try using Tumbleweed instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26documentation: remove mention of Grantlee in INSTALL fileGravatar Dirk Hohndel
We don't use Grantlee anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: fix deprecated QVector constructorGravatar Dirk Hohndel
Annoyingly, the replacement has only been available since Qt 5.14. To make the code less messy, implement our own stdToQt conversion helper. Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: remove struct/class confusionGravatar Dirk Hohndel
DiveSiteChange is defined as a struct, not as a class. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: move variable declaration closer to useGravatar Dirk Hohndel
This way we avoid an unused variable warning on mobile builds. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: remove reference to deprecated enum valueGravatar Dirk Hohndel
This had been deprecated for quite a while. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: remove unnecessary call to qsrandGravatar Dirk Hohndel
We actually don't use random numbers anywhere outside TestGitStorage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: replace deprecated swap() usageGravatar Dirk Hohndel
Instead of using the two different ways Qt supports swap, depending on the Qt version in use, let's simply use std::swap() Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: replace deprecated pos() memberGravatar Dirk Hohndel
Again, replacement was just recently added. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: remove unused function argumentGravatar Dirk Hohndel
Also, only compile the static function where it is used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: replace long obsolete delta() memberGravatar Dirk Hohndel
This has been deprecated for years. The delta() member dealt with the old style mouse wheel that is associated with a vertical scroll - so we need the y-component. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: don't initialize flags with just an integerGravatar Dirk Hohndel
This is slightly different from the previous cleanup around QFlag use as this one is related to QtWebKit flags. But the logic is the same. Just syntax to avoid a warning. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: replace deprecated signalGravatar Dirk Hohndel
Again, the replacement was only implemented in Qt 5.14, so more conditional code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: SkipEmptyParts syntax has changedGravatar Dirk Hohndel
Sadly, the new enum has only been available since Qt 5.14, so this is a rather ugly replacement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: model isn't used in the lambdaGravatar Dirk Hohndel
Simply cleaning up a warning. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: replace deprecated sprintf()/vsprintf() callsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: remove obsolete connectionsGravatar Dirk Hohndel
Not sure how this even ended up in this .ui file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: fix deprecated roleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: replace deprecated use of child memberGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: fix deprecated form of QProcess::startGravatar Dirk Hohndel
You are now required to always provide a list of arguments. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: fix deprecated QFlags useGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: initialize all members of weightsystemGravatar Dirk Hohndel
The auto_filled member was recently added and not initialized in the UEMIS downloader. Fixes CID 362080 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: fix resource leakGravatar Dirk Hohndel
Fixes CID 362078 Fixes CID 362081 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26cleanup: fix resource leakGravatar Dirk Hohndel
And address typo in comment. Fixes CID 362915 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-25filter: use 64-bit integer literal for generating bit fieldsGravatar Berthold Stoeger
For multiple-choice constraints we use a bit field of type uint64_t. This means we theoretically support up to 64 items. Currently use at most seven. Coverity complained (correctly) that we use the expression "1 << x" to generate the bitfields. However 1 is a 32-bit literal on most platforms, which makes this undefined behavior for x >= 32. Change the integer literal to 64-bit 1ULL. Moreover, when detecting items with an index >= 64, don't even attempt to set the according bit, since this is undefined behavior and the compiler is free to do as it pleases in such a case. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: remove pref.h include in dive.hGravatar Berthold Stoeger
If source files want to access preferences functions, they should include pref.h themselves. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move git-pref declarations into core/pref.hGravatar Berthold Stoeger
These seem to be an artifact. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move sort_dive_table declaration to divetable.hGravatar Berthold Stoeger
Apparently this was forgotten in a previous include-reshuffling. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move cylinder_use_text declaration to equipment.hGravatar Berthold Stoeger
This is unrelated to struct dive and also wasn't defined in dive.c Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: remove unused macros / declarations from dive.hGravatar Berthold Stoeger
Nobody was using these return-code macros and the functions do not exist since a long time. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move interpolate inline function to its own header fileGravatar Berthold Stoeger
This is not really related to struct dive, so let's move it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: remove system includes from dive.cGravatar Berthold Stoeger
Let the various source files include the system headers they need themselves. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move application flags to core/subsurfacehelper.hGravatar Berthold Stoeger
These flags are not dive-related, therefore move their declaration to the appropriate header file. Likewise, move their definition from parse-xml.c to subsurfacehelper.c Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move function declarations to divelist.hGravatar Berthold Stoeger
unregister_dive() and delete_single_dive are defined in divelist.c, as they take an "index" argument into the global divelist. Therefore, move their declarations to divelist.h. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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-10-25cleanup: remove get_times() functionsGravatar Berthold Stoeger
The function 1) was misnamed: it determined the time of the first selcted dive. 2) had only one caller. 3) would crash if there was no selected dive. Let's just fold the functionality into the caller. It's a one-liner anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move fill_pressures from dive.c to gas.cGravatar Berthold Stoeger
This function does not access a dive structure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: break out event-related code into event.[c|h]Gravatar Berthold Stoeger
In an effort to reduce the size of dive.h and dive.c, break out the event related functions. Moreover event-names were handled by the profile-code, collect that also in the new source files. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: remove DiveComputerModel::removeGravatar Berthold Stoeger
This was used by the DiveComputerDialog, which does not exist anymore. The new tab uses the function in the corresponding sorted model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: move mark_divelist_changed() to qmlmanager.cppGravatar Berthold Stoeger
Desktop does not use mark_divelist_changed() anymore - all is done via the undo machinery. Therefore move this function (and its counterpart unsaved_changes()) to qmlmanager.cpp. Ultimately, it probably should be removed from there as well, but currently I don't dare to touch all the cloud-logic! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: remove MainWindow::setFileClean()Gravatar Berthold Stoeger
This function was used to unify both methods of tracking unsaved changes. Since desktop now only uses the undo system, it can be replaced by a single call to "Command::setClean()". Arguably, the UI is the wrong place to do this and the appropriate calls should be done by the core. However, let's play it safe for now and avoid any breaking change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: remove unsaved_changes() test in testrenumber.cppGravatar Berthold Stoeger
Unsaved changes are now kept track by the undo-system. No need to test for this function when directly modifying the core data structures. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25cleanup: remove MainWindow::unsavedChanges() functionGravatar Berthold Stoeger
This function was used to unify both methods of checking for unsaved changes: the global unsaved_changes() flag and the Command::clean() function of the undo-system. However, all desktop functions are now undoable and therefore the function is not needed and can be replaced by calls to !Command::clean(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25desktop: remove DiveComputerManagementDialogGravatar Berthold Stoeger
This is now done in a TabWidget with undo-support. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25devices: connect DiveComputerModel to undo-commandGravatar Berthold Stoeger
Instead of modifying the device table directly, call the undo commands. Moreover, don't keep our own copy in the mode - show the original version. Connect to the appropriate signals. This means that the calls from the DiveComputerManagement dialog have to be removed, since this mode of editing is not supported. The whole dialog will be removed in a future commit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25models: update DiveComputerModel when core data is resetGravatar Berthold Stoeger
To implement undo-semantics, we want a longer-lived dive-computer-model (currently, it is regenerated when the dialog is opened). Therefore, it must be reloaded when the core data is reset. Do this like for other models: listen to the dataReset() signal of DiveListNotifier. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>