aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-01-10Replace CREATE_PP_GAS macro by member function in profilewidget2.cppGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Remove two arguments from ProfileWidget2::setupItem()Gravatar Berthold Stoeger
1) hAxis was always set to timeAxis 2) model was always set to dataModel Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Replace ADD_ACTION macro by member function in profilewidget2.cppGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Replace HIDE_ALL macro by template function in profilewidget2.cppGravatar Berthold Stoeger
This is easier to read and debug. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Remove unnecessary deletes in destructor of ProfileWidget2Gravatar Berthold Stoeger
All the deleted items were added to the scene, which takes "ownership" (a remarkably fuzzy concept in Qt) of these objects. In principle, deleting these items is a bug - even though it is handled gracefully. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10mobile: fix crash on delete dive from divelistGravatar Jan Mulder
This is a somewhat hacky commit. For a very long time, the delete from the divelist on mobile crashed. That is, not always for anyone, but for me almost consistently. This commit tries to solve it. I found that trying to save the delete immediately after removing data from the underlying model seemed to cause the crash. Hacking around, I found that a simple beginResetModel/endResetModel between the delete of the underlying model data and actual save is sufficient to solve the crash. The big question is, why does this all work? I suspect some of race condition between deleting model data, and giving the QML engine the opportunity to do its thing. This is also related to issue #311, but that is not implemented here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10cleanup: fix possbile buffer overrunGravatar Jan Mulder
No reason to mess around with a 5 byte buffer when we have a proper buffer available to receive a possibly 8 byte output based on the format string. And silences compiler warning. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10cleanup: initilize local variableGravatar Jan Mulder
Silence compiler warning by correctly initializing local variable. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10GpsLocation::clearGpsData() is only used in SUBSURFACE_MOBILEGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: GpsListModel::addGpsFix()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove ProfileWidget2::isAddOrPlanner()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: has_hr_data()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove CCRMax() and used macroGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: DiveCartesianAxis::percentAt()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: GroupedLineEdit::removeAllColors()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: report_message()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove taglist_contains_all()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove weightsystems_equal()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: weekday()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove taglist_equal()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove shift_times()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove trip_has_selected_dives()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove PluginManager::socialNetworkIntegrationPlugins()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove DiveCartesianAxis::tickInterval() and tickSize()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10build system: split qt-models into partsGravatar Jan Mulder
For a long time, I did not realize that a lot of qt-models are only used in the mobile app, or only used in the desktop application. This commit splits the qt-models in 3 parts. Used in both mobile and desktop, used in desktop only, used in mobile only. There is no other code change in here, other than cmake changes. To me, this gives at least developers more insight where code is actually used, and there is a small benefit in footpoint. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Move function to proper placeGravatar Jan Mulder
Instead of writing TODO comment blocks, just do the work, and move the function to the proper class. Further, after review from Berthold, cleanup the function. There is no reason that getGasList() is member of any class. It is just a non-class helper, and as it is only used here, a static helper. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-08Remove redundant setting of prefs.git_local_onlyGravatar Berthold Stoeger
In MainWindow::on_actionCloudOnline_triggered(), prefs.git_local_only was set twice in the case of going online. Remove the second, unnecessary, assignment. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Move resetting of current file out of clear_dive_file_data()Gravatar Berthold Stoeger
This is the only case where C-code sets the current file. Remove this call for a better separation of C-backend and C++-frontend parts. There were four callers of clear_dive_file_data(). Two of them would call set_filename() anyway. For the remaining two add an explicit call to set_filename(). This commit fixes a bug introduced in commit b3901aa8f90499ee2a34efdddc2463105afc53f1: The cloud-online menu entry was still enabled after "closing" the cloud storage. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Enter offline mode if sync with cloud failedGravatar Berthold Stoeger
In case syncing with the online repository failed, enter offline mode. This reflects the message sent to the user ("working with local copy"). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Make a few functions of static linkageGravatar Berthold Stoeger
Make functions in core/file.c, core/parse.c and core/import-csv.c that were not used outside their translation unit of static linkage. parse_date is moved from core/file.c to core/import-csv.c, since it is used only there. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Remove unused function parse_mkvi_buffer()Gravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Remove obsolete error/debug messagesGravatar Miika Turkia
The used parse_dl7_new_line function already prints an error / debug message so these are unnecessary. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add water temperature to test diveGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Parse water temperature from ZDTGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Function to look for new line on DL7 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Parameter size needs to be increased for testGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Update latests changes to test diveGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Use dynamic indexing instead of hard codedGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add support for air temp on DL7 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add support for air and water temps for CSV importGravatar Miika Turkia
Add support of importing air and water temperatures from DC header information. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add support for max and mean depths for CSV importGravatar Miika Turkia
Add support of importing max and mean depths from DC header information. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Update DL7 tests to current importGravatar Miika Turkia
As we now parse dives without profile, we get 2 more dives from the sample log import (3 in total). And naturally also the resulting XML to compare against needs to be updated. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Dummy parse empty divesGravatar Miika Turkia
Easiest way to get dives without profiles in, is to just parse empty csv tags. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Stricter check we get dive profileGravatar Miika Turkia
We should get either dive trailer or dive profile immediately after header. Thus make sure that is the case. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Ignore empty divesGravatar Miika Turkia
This is first step towards parsing "empty" dives properly. I.e. now the updated test dive parses properly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Compare DL7 import to saved conversionGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add converted DL7 file for test validationGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add two dive headers to DL7 sampleGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Refactor CSV importGravatar Miika Turkia
Move CSV import related functions into import-csv.c. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add test for DL7 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>