aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-08-05Android: build latest libzipGravatar Dirk Hohndel
Small hacks needed, but otherwise this seems to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-05Update to latest libdcGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-04iOS: fix libzip build instructionsGravatar Dirk Hohndel
Recent libzip no longer supports autotools. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-04Android: build libzip 1.1.3Gravatar Dirk Hohndel
Switching to GitHub as source for libzip means that we need to encode the version number differently. Newer versions of libzip don't compile cleanly on Android and this one seems new enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-04build-system: update libzip to 1.5.1Gravatar Dirk Hohndel
This also switches us to libzip's new official home on GitHub, and takes into account that libzip no longer supports autotools and instead now is cmake based. Building against that, on my Mac build system, Subsurface once again correctly opens DLD files downloaded from divelogs.de. Fixes #1534 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-04divelogs.de import: improve export for temperatureGravatar Miika Turkia
Add support for exporting dive temperatures if they are user entered instead coming from a DC. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-08-02core: qPref, remove inline and ; for inline functionsGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-02tests: add Units qml test casesGravatar jan Iversen
Add tst_qPrefUnits qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-02tests: move Units test from testpreferencesGravatar jan Iversen
Remove Units test in testpreferences add the same Units tests to testqPrefUnits Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-02tests: add qPrefUnits testcasesGravatar jan Iversen
add test cases to secure struct preferences and qPrefUnits work together Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-02core: activate qPrefUnitsGravatar jan Iversen
remove Units from SettingsObjectWrapper and reference qPrefUnits update files using SettingsObjectWrapper/Units to use qPrefUnits this activated qPrefUnits and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-02core: create qPrefUnit 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-08-02core: change type of unit_system to enumGravatar jan Iversen
unit_system is an enum, but was declared as short, correct declaration. Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-02Cleanup: shrink size of three-letter month name strings to 4Gravatar Berthold Stoeger
There was a comment reading /*++GETTEXT: these are three letter months - we allow up to six code bytes*/ but this is not valid (anymore), since the array contains only untranslated strings, which will be translated on-the-fly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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>