aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-12-18Update CHANGELOG.mdGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Implement different zoom levels for dive photos tabGravatar Berthold Stoeger
This implements different zoom levels for the dive photos tab as suggested by Stefan Fuchs <sfuchs@gmx.de> in #898. The zoom level can be changed using a slider or CTRL+mousewheel. Zoom levels range from a third of the standard thumbnail size to thrice the standard thumbnail size. Thumbnails are cached in maximum resolution and scaled down on the fly. Because the profile widget took its pictures from the photo list model, an extra picture copy with a fixed size had to be introduced. The UI is still a bit crude. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Make protected DivePictureModel members privateGravatar Berthold Stoeger
The constructor and the list of pictures was protected, but the class neither had friends nor subclasses (a subclass was removed in a recent commit). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Make scaleImages() a static functionGravatar Berthold Stoeger
It was only used by the DivePictureModel class, no need to export it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18core: ignore bogus m in cylinderGravatar Jan Mulder
A bogus key/value pair was introduced in the cylinder, consisting of a lonely "m" without value. This is caused by commit 46004c39e26 and fixed in 48d9c8eb6eb0. See referenced commits for more info. Just ignore this key/value pair. No processing is broken due to this, as the git storage stores only metric SI type data. In fact, the m unit is superfluous anyway. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18Allow to read factor cache concurrentlyGravatar Robert C. Helling
In a session with the profile I saw that the planner spends a lot of time waiting to obtain the lock for the factor cache. Most of the time we are only reading that cache and that is save to do in parallel (according to the Qt IRC channel). So we can use a QReadWriteLock instead of a QMutex. This appears to be quite a performance boost, in particular for VPM-B Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-18Update download URL for libzipGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-18Compile with -O2 optimization even in debug modeGravatar Berthold Stoeger
The -O0 default is useless owing to extremely convoluted assembly. Moreover, many warnings depending on data analysis are ineffective with -O0. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18CHANGELOG.mdGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18mobile: exit edit mode when navigating away from edit pageGravatar Jan Mulder
Navigating using the breadcrumb in the header did leave the dive detail edit (and add) mode in such a way that (for example) navigation in the dive list was suspended. Obviously, it is debatable what should be done. Saving the edits/add, or cancelling them. For now, this commit cancels them silently. This is the exact same thing that is happening when the user selects the dive list from the drawer menu. Fixes: #932 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18Elevate "can't write hashes" message from debug to warning levelGravatar Berthold Stoeger
I never realized that my hashes weren't written, because it only outputs a debug instead of a warning message. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18core: fix git storage save (regression 4.7.4 -> 4.7.5)Gravatar Jan Mulder
Commit 46004c39e266fe7 introduces a new field in the logbook outputs (depth of a cylinder). While in XML the depth unit is stored with a space between value and unit (m), in our git storage, the unit m is without space. As the git storage parser uses a space to separate individual key/value pairs, the erroneously saved space results in parsing warnings when opening the logbook. The unwanted space is normally saved just after download of a new dive from the dive computers, so all desktop-git-storage uses are affected, and more worrying, mobile beta users. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-17Cleanup: mark parameter as unusedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-17CLeanup: remove duplicate typedefGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-17Cleanup: durations are now signedGravatar Dirk Hohndel
Somehow a whitespace fix snuck in here. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-17Cleanup: fix potential uninitialized use of uuidGravatar Dirk Hohndel
And make sure we don't create a dive site for an empty location string. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-17Turn on -WallGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-17mobile: use short date format in edit modeGravatar Jan Mulder
See issue #949. In the dive list, dates are shown in short format, and when we start to edit an existing dive, the date field on the edit page is shown in sort format. However, when adding a new dive, the initial date shows up in long (normal) format. This in not only inconsistent, but also introduces the parsing problem, as described in the mentioned issue. This can be fixed by using short formatted dates in all cases in the mobile app. As the screen real estate is precious on mobile, this seems the most logical choice. Fixed: #949 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-17Unify float calulations: use doubleGravatar Berthold Stoeger
Internal floating point (FP) calculations should be performed using double unless there is a very good reason. This avoids headaches with conversions. Indeed, the vast majority of FP calculations were already done using double. This patch adapts most remaining calculations. Not converted where things that were based on binary representations and variables which weren't used anyway. An analysis of all instances follows: core/plannernotes.c, l.404: This was a comparison between two floats. On the left side, first an integer was cast to float then multiplied with and integer and divided by a constant double. The right hand side was an integer cast to a float. Simply divide by 1000.0 first to convert to double and continue with calculations. On the right hand side, remove the cast, because the integer will be implicitely cast to double for comparison. This conversion actually emits less instructions, because no conversion to double and back is performed. core/planner.c, l.613: Same analysis as previous case. subsurface-desktop-main.cpp, l.155: A local variable representing the version OpenGL version. Turn this into integer logic. Not only does this avoid dreaded FP rounding issues, it also works correctly for minor version > 10 (not that such a thing is to be expected anytime soon). abstractpreferenceswidget.[h/cpp]: A widget where the position is described as a float. Turn into double. desktop-widgets/divelogexportdialog.cpp, l.313: total_weight is described as float. Use double arithmetics instead. This instance fixes a truncation warning emitted by gcc.
2017-12-16mobile: manual add dive and cancel fails when repeatedGravatar Jan Mulder
This commit fixes a very subtle bug. Probably there for ages, but never noticed. When manually adding a dive, and canceling the add right away, the divetable was extended by 1 dive (using the core function add_single_dive), but canceling never removed that dive (using delete_single_dive). This is corrected here. Notice that commit ef543da5aff296e claims to fix issue #950. With this commit, however, that issue can be seen sometimes again. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-15divepicturemodel: Reset start and end row for displayed_dive correctlyGravatar Stefan Fuchs
Correct way of using indices for rowDDstart and rowDDend. Reset rowDDstart and rowDDend at beginning of updating dive pictures. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-15mobile: clear internal data when edit/add dive is finishedGravatar Jan Mulder
When editing (or adding) a dive, the internal data containing the attributes on the edit page was not cleared when editing was finished (in any way, by saving the edit or by cancelling it). As long as the user only edits existing dives, all this poses no problem, as at the start of a dive edit, the data is filled from the dive to be edited. However, when adding a dive, data coming from previous edits shows up. This not clearing data also causes the strange effect as written in issue #950: adding a dive, deleting it, and adding a dive again, added the first added dive data, without the edit screen being shown. All this can be solved by clearing the data from the edit when editing is done. Fixes: #950 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-14Add git submodule init to build scriptGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-14CHANGELOG.mdGravatar Jan Mulder
I think that every published issue that is fixed should be in the changelog. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-14mobile: stay on same dive after editGravatar Jan Mulder
See issue #875. In hindsight the reason for this bug is easy to understand. When updating a dive, the dive was first removed from the model, and added in its new state again. This does seems resonable, but the delete in the model causes the internal (QML) state to be changed, and the previous state (like the currentIndex that was pointing to the just deleted row, so that one is changed to something valid internally) is not restored at recreation of the edited dive. The QML engine has no way to understand that the remove and subsequent add are in fact one atomic operation. This can be solved by simply updating the underlying data in place, and notifying the change using a dataChanged emitted signal. The dataChanged signal takes care of the repaint of the screen, and there is no need for removeRow/insertRow pairs. Fixes: #875 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-14mobile: show message when going offlineGravatar Jan Mulder
Trivial fix. Show the message "Turning off automatic sync to cloud ..." when turning automatic sync to offline. Just a more logical moment to show this message. Also rephrase the message "Enable auto sync" to "Auto sync enabled". It shows a status, and not an action. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-14Don't create GeneralSettingsObjectWrapper objectGravatar Berthold Stoeger
Instead use the application-wide instance. Creating a local object defeats the whole purpose of these objects - nobody can receive signals in case the settings changed. No other cases of locally created SettingsObjectWrapper objects were found. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-14Remove function isCloudUrl()Gravatar Berthold Stoeger
The function isCloudUrl() was only called in one place, parse_file(). But, isCloudUrl() could only return true if the filename was of the git-repository kind (url[branch]). In such a case, control flow would never reach the point where isCloudUrl() is called, since is_git_repository() returns non-NULL and the function returns early. Therefore, remove this function. Moreover, adapt the affected if-statement by replacing "str && !strcmp(str, ...)" with the more concise "same_string(str, ...)". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-13CHANGELOG.mdGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13mobile: reset download screen in a sane stateGravatar Jan Mulder
Set download srceen in a sane state after a previous download session using this screen. The erroneous behavior was very similar to the one fixed in commit 7fe9bbe295dcf92. For example, download some dives, quit the screen, go back, and the bottom buttons are still selectable. This commit resets some values when leaving the download screen (ie. not only swiping it away), so that it looks sane at a next visit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13mobile: reset Retry button to DownloadGravatar Jan Mulder
Reset the Retry button on exit of the Download from divecomputer page. So, it it not reset wehen swiping this page away, or cancelling a running download, but resetting it on accepting downloaded dives. As we do not have real error reporting (from download failures), this all is a little arbitrary. Another "fix" could be, not changing the button text at all. Further notice, this is not specific iOS, but also Android. Fixes: #895 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13Add CHANGELOG for the last mergeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-13Enable removal of pictures from different dives at the same momentGravatar Stefan Fuchs
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13Fine tune the position of pictures in the profileGravatar Stefan Fuchs
Start a new column a little bit earlier otherwise it will get difficult to fit a high number of pictures. Don't put more than ~16 pictures in one column. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13Reenable picture tab when dive trip is selectedGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13Dive pictures show pictures of all selected divesGravatar Stefan Fuchs
In the dive picture tab show pictures of all selected dive. But at the same moment take care that in the profile only pictures from displayed_dive are displayed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13Remove unused divesitepicturemodel from qt-modelsGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13applying gps fixes: group repetitive code under a macroGravatar Jan Mulder
See 2182167b533b4c. Keep the dupicated code in sync. Originally-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13Do not prefer gps fixes just for being into dive timeGravatar Jan Mulder
See commit 6f42ab46da1b5956. Unfortunately, this code is duplicated (and an obvious candidate for code cleanup). So replicate the mentioned commit here. In fact, the mentioned issue #666 talkes about the mobile app, and the fix was only done for the desktop. Originally-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13mobile: do not just create a new dive siteGravatar Jan Mulder
This fixes an annoying bug. When entering an existing divesite in the mobile app, always a new divesite (with same name) was created, resulting in multiple sites on the same gps location. So, be more carefull in checking and creating a new site. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13CHANGELOG.mdGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13Add pSCR divemode detectionGravatar Jan Mulder
In libdivecomputer, a new divemode is added (DC_DIVEMODE_SCR) useful for dive computers that have specfic functionality for semi-closed rebreathers. At this moment, only the HW computers seem to provide this. This commit takes care of proper recognition of this new divemode when importing data from a dive computer. Tested on an actual import from an OSTC3 that contained dives in this new mode. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13Rename DC_DIVEMODE_CC to DC_DIVEMODE_CCRGravatar Jan Mulder
This is just code cleanup. Jef renamed the CCR divemode constant in libdivecomputer, but added a define to be backward compatible as as well (so this rename did not break our Subsurface build). Obviously, this breaks the build for people that build against an older libdivecomputer, but I see no reason to do that. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-12Update to the latest libdc versionGravatar Dirk Hohndel
This gets us the first merge with the upstream iostream implementation. This requires a small change for serial_ftdi.c to build. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-11Simplify mainwindow title logic: remove MainWindowTitleFormat enumGravatar Berthold Stoeger
The MainWindow::setTitle() function was passed an enum, which depended on whether existing_file is set or not. The check can be (and was!) done directly in setTitle(). Therefore, remove the whole enum. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-12Remove unused variable in on_actionCloudstorageopen_triggered()Gravatar Berthold Stoeger
This was an artifact of commit 136110784ebe2a188ca867bea3a7ff3037281a57 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11Write profile images to correct directory in TeX exportGravatar Robert C. Helling
Before, we did not look at the path of the filename to export to but we should write the images there and not in pwd. Fixes #931 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-11Use the copy_string() helper function in set_filename()Gravatar Berthold Stoeger
copy_string() does the same as the current code, but in one instead of four lines. Strictly speaking, it does not exactly the same thing because the empty string ("") case is handled differently. copy_string() returns NULL instead of a copy of "", which is probably preferred anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11Remove second parameter (bool force) in set_filename()Gravatar Berthold Stoeger
The last force=false case was removed in commit 96d1cc570e31396039e4970d2bf75d5f00f1e550. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11Fix broken link in CONTRIBUTING.mdGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>