aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-08-02Cleanup: move sort_table() from subsurface_startup.c to divelist.cGravatar Berthold Stoeger
The function is not only used at startup and arguably belongs the the file with the rest of the low-level divelist functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-01Cleanup: remove all override modifiersGravatar Berthold Stoeger
Commit df156a56c08a56eb380711a507ef739d8150a71f replaced "virtual" by "override" where appropriate. Unfortunately, this had the unintended consequence of producing numerous clang warnings. If clang finds a override-modified function in a class definition, it warns for *all* overriden virtual functions without the override modifier. To solve this, go the easy route and remove all overrides. At least it is consistent. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-01Cleanup: remove silly " != 0" expressionGravatar Berthold Stoeger
In metadata.cpp, replace a silly "if (!memcmp(...) != 0)" by the intended "if (!memcmp(...))" Obviously, both have the same effect. Fixes a warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-31Cleanup: replace virtual by override where appropriateGravatar Berthold Stoeger
The keyword "virtual" signalizes that the function is virtual, i.e. the function of the derived class is called, even if the call is on the parent class. It is not necessary to repeat the "virtual" keyword in derived classes. To highlight derived virtual functions, the keyword "override" should be used instead. It results in a hard compile- error, if no function is overridden, thus avoiding subtle bugs. Replace "virtual" by "override" where appropriate. Moreover, replace Q_DECL_OVERRIDE by override, since we require reasonably recent compilers anyway. Likewise, replace /* reimp */ by "override" for consistency and compiler support. 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-07-30Cleanup: remove DiveListView::fixMessyQtModelBehaviour()Gravatar Berthold Stoeger
The function DiveListView::fixMessyQtModelBehaviour() was used to expand the first columns of dive-trips in the dive-list view. This function was called everytime that the dive-list was modified. It is kind of ludicrous that external callers would have to tell the DiveListView, when it has to update its column headers. Instead, place this functionality in the overriden reset() and rowsInserted() functions, as these are the only ways that rows can be added. Change the DiveTripModel to use the proper beginResetModel()/endResetModel() pair instead of the previous full deletion and full repopulation using the beginRemoveRows()/ endRemoveRows() and beginInsertRows()/endInsertRows(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-30Cleanup: remove parameter from currentDiveChanged signalGravatar Berthold Stoeger
The currentDiveChanged signal was emitted by the DiveListView to inform the MainWindow of a change of current dive. The new current dive was passed as a parameter. The slot in MainWindow then called select_dive() on the dive. This seems pointless because: 1) In both emits, selected_dive dive was passed as argument. But MainWindow can read this global variable itself. 2) Calling select_dive() again is a no-op, because obviously, this already *was* the selected dive. Moreover it seems conceptually wrong to set the current dive in the slot that is informed of the change of the current dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-30tests: add Proxy qml test casesGravatar jan Iversen
Add tst_qPrefProxy qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30tests: move Proxy test from testpreferencesGravatar jan Iversen
Remove Proxy test in testpreferences add the same Proxy tests to testqPrefProxy Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30tests: add qPrefProxy testcasesGravatar jan Iversen
add test cases to secure struct preferences and qPrefProxy work together Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30core: activate qPrefProxyGravatar jan Iversen
remove Proxy from SettingsObjectWrapper and reference qPrefProxy update files using SettingsObjectWrapper/Proxy to use qPrefProxy this activated qPrefProxy and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30core: create qPrefProxy from SettingsObjectWrapperGravatar jan Iversen
Update set/get functions to follow common name scheme: - get function have same name as in struct prefs - set function have set_<name> - signal function have <name>_changed one class one .h/.cpp is the C++ idiom. Having load/sync of each variable in 1 functions (in contrast to the distributed way SettingsObjectWrapper handles it) secures the same storage name is used. Having the set/get/load/sync functions grouped together makes it easier to get an overview. REMARK: this commit only defines the class, it is not active in production Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30ssrf: simplify Register/check calls in subsurface-helperGravatar jan Iversen
Add REGISTER_TYPE macro, that expands to register_type and the "if" There are no functional changes, but the code is a lot easier to read. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30tests: correct test_multiple in all qPref classesGravatar jan Iversen
test_multiple did not test correctly, correct. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30core: qPrefPrivate.h added HANDLE_PREFERENCE_INT_DEF_EXTGravatar jan Iversen
Add missing type macro, needed for qPrefProxy Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-30Cleanup: remove DiveListView::testSlot()Gravatar Berthold Stoeger
This debugging-slot was not linked anywhere. And especially in the light of the impending refactoring of DiveListView/DiveTreeModel it seems pointless to keep old debugging code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-29BT support: disable BT download when compiling without BTGravatar Kristaps Dz
When BT_SUPPORT is not enabled, don't default to "true" for using bluetooth for downloading dives. Otherwise, bluetooth will be forced since the bluetooth button has been removed and is never overridden. Fixes #1541 Signed-off-by: Kristaps Dzonsons <kristaps@bsd.lv>
2018-07-28CHANGELOG.md updateGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-28Dive media: put duration on video thumbnailsGravatar Berthold Stoeger
On the profile, the run-length of the videos is visualized by a bar. Add the same information to video-thumbnails in the dive-photo-tab. Though in this case, render it as text on top of the thumbnails. Fixes #359 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-28Dive media: Extract thumbnails from videos with ffmpegGravatar Berthold Stoeger
Extract thumbnails using ffmpeg. Behavior is controlled by three new preferences fields: - extract_video_thumbnails (bool): if true, thumbnails are calculated. - extract_video_thumbnail_position (int 0..100): position in video where thumbnail is fetched. - ffmpeg_executable (string): path of ffmpeg executable. If ffmpeg refuses to start, extract_video_thumbnails is set to false to avoid unnecessary churn. Video thumbnails are marked by an overlay. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-28Build-system: add OpenBSD supportGravatar Kristaps Dz
Rename linux.c to unix.c and add OpenBSD support as well. Conditionally compile based on OS. Signed-off-by: Kristaps Dzonsons <kristaps@bsd.lv>
2018-07-27tests: add Facebook qml test casesGravatar jan Iversen
Add tst_qPrefFacebook qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27tests: move Facebook test from testpreferencesGravatar jan Iversen
Remove Facebook test in testpreferences add the same Facebook tests to testqPrefFacebook Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27tests: add qPrefFacebook testcasesGravatar jan Iversen
add test cases to secure struct preferences and qPrefFacebook work together Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27core: activate qPrefFacebookGravatar jan Iversen
remove Facebook from SettingsObjectWrapper and reference qPrefFacebook update files using SettingsObjectWrapper/Facebook to use qPrefFacebook this activated qPrefFacebook and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27core: create qPrefFacebook from SettingsObjectWrapperGravatar jan Iversen
Update set/get functions to follow common name scheme: - get function have same name as in struct diveComputer - set function have set_<name> - signal function have <name>_changed one class one .h/.cpp is the C++ idiom. Having load/sync of each variable in 1 functions (in contrast to the distributed way SettingsObjectWrapper handles it) secures the same storage name is used. Having the set/get/load/sync functions grouped together makes it easier to get an overview. REMARK: this commit only defines the class, it is not active in production Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27tests: correct name in tst_qPrefDisplay.qmlGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27tests: update qPrefCloudStorage tests for git_urlGravatar jan Iversen
update tests to reflect that git_url is derived from base_url Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27core: fix qPrefCloudStorage to derive git_urlGravatar jan Iversen
remove set_git_url and git_url_changed, because it is not possible to set git_url, this is done inderectly through set_base_url Update disk_base_url to generated git_url for both load/sync Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27Dive list view: setup columns in constructorGravatar Berthold Stoeger
The column-widths must only be set once the source-model is that. The old code realized this with a rather complicated logic. Instead, simply set the source-model in the constructor and set the column widths after that. Rename the corresponding function from "setupUi" to "setColumnWidths". Moreover, the setupUi function had different code-paths for the first and other calls. Since it is only called once, remove the other code paths. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-27Dive list view: move column width logic back from DiveTripModelGravatar Berthold Stoeger
Conceptually, the width of the columns should probably reside in the view not the model. But much more severly, the old code didn't work: Columns were set in a DiveTripModel, which was deleted right away. Therefore, move the logic back to the DiveListView. Introduce a QVector<int> of the initial column widths, so that they can be erased from the setting if unchanged. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-26Update CodingStyle.md: placement of *, & and && declaratorsGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-26Whitespace cleanup core divecomputer handlingGravatar Dirk Hohndel
Not entirely script based because of two odd issues where the script creates bogus indentation. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-26Whitespace cleanup desktop-widgetGravatar Dirk Hohndel
Not entirely script based because of the broken 'else if'. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-26Whitespace cleanup main/helper filesGravatar Dirk Hohndel
Again, entirely script based. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-26Whitespace cleanup testsGravatar Dirk Hohndel
Again, entirely script based. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-26Whitespace cleanup core/settingsGravatar Dirk Hohndel
We can argue about any of the changes here, but they are the result of our whitespace.pl script - so if any of this is offensive to you, part of the resolution will be fixing the script... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-26Small edit of whitespace scriptGravatar Dirk Hohndel
This makes sure we don't end up indenting macro invocations. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-25core: qPrefCloudStorage save userid to new locationGravatar jan Iversen
userid was saved outside all groups, even though it belongs to cloudStorage Add code to save in new location and read from new/old location Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25tests: add DiveComputer qml test casesGravatar jan Iversen
Add tst_qPrefDiveComputer qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25tests: move DiveComputer test from testpreferencesGravatar jan Iversen
Remove DiveComputer test in testpreferences add the same DiveComputer tests to testqPrefDiveComputer Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25tests: add qPrefDiveComputer testcasesGravatar jan Iversen
add test cases to secure struct preferences and qPrefDiveComputer work together Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: activate qPrefDiveComputerGravatar jan Iversen
remove DiveComputer from SettingsObjectWrapper and reference qPrefDiveComputer update files using SettingsObjectWrapper/DiveComputer to use qPrefDiveComputer this activated qPrefDiveComputer and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: update qPrefDisplay to new consensusGravatar jan Iversen
add inline to load/sync remove const from QString getters Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: update qPrefCloudStorage to new consensusGravatar jan Iversen
make load/sync inline remove const from QString getters Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: make load/sync inline in qPrefGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: make load/sync inline in qPrefAnimationsGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: create qPrefDiveComputer from SettingsObjectWrapperGravatar jan Iversen
Update set/get functions to follow common name scheme: - get function have same name as in struct diveComputer - set function have set_<name> - signal function have <name>_changed one class one .h/.cpp is the C++ idiom. Having load/sync of each variable in 1 functions (in contrast to the distributed way SettingsObjectWrapper handles it) secures the same storage name is used. Having the set/get/load/sync functions grouped together makes it easier to get an overview. REMARK: this commit only defines the class, it is not active in production Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: add qPrefAnimations to SettingsObjectWrapper/qPref loadGravatar jan Iversen
correct missng qPrefAnimations in global load functions Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: expand qPref macros to handle sub structureGravatar jan Iversen
Expand SET_, DISK_ and HANDLE_ macros with field for substructure Structure prefs contains e.g. prefs.dive_computer.vendor an extra field are added to the macros to allow this. Signed-off-by: Jan Iversen <jani@apache.org>