aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-06-22Do not mess with dive location automaticallyGravatar Tomaz Canabrava
This might be what the user wanted, but also might not be it. So wait for the user to request it manually. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Create layout on parent, not on items around itGravatar Tomaz Canabrava
Correctly handles resizing of interface items by creating the layout on the parent instead of selecting the items and applying the layout around them. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22do not set default sizes for expandersGravatar Tomaz Canabrava
This was creating a lot of empty spaces on the preferences dialog and making Dirk unhappy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Cloud storage: update File menu options once PIN is verifiedGravatar Dirk Hohndel
The code didn't trigger the update routine after PIN verification, only if just email/password were shown. A simple oversight. This is fixed now and so the visibility of cloud open and cloud save options should refelect whether verified credentials are in the preferences or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Prevent potential division by zeroGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Prevent null pointer dereferenceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Better error handlingGravatar Dirk Hohndel
Most of these will likely have no big impact, but it's better not to just ignore them as they could lead to crashes. Uemis downloader: if lseek fails, return 0 Uemis downloader: consistently check for failure to open req.txt Zip file handling: dup could fail Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Address of array is always non-NULLGravatar Dirk Hohndel
We want to test the string instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Address uninitialized member warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Cloud storage: correctly store pictures even if they weren't shown beforeGravatar Dirk Hohndel
We could end up in a situation where the hash for a picture hadn't been recorded yet and then the lookup to make sure that we find the correct file actually got us nothing. Now we make sure that the picture is in the hash table before looking up the file location and before creating the name of the blob that we store in git. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Preferences: don't show error when resetting cloud email / passwordGravatar Dirk Hohndel
Empty values won't work, of course, but they aren't an error, either. Fixes #887 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Initialize membersGravatar Dirk Hohndel
Globe: initialize doubleClick member ShiftTimesDialog: initialize when (not sure this could be a problem) SetpointDialog: dc could be uninitialized or could be 0 and dereferenced Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Uemis downloader: open returns -1 on errorGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Prevent unintended integer divisionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Comparing the address of a member to 0 is pointlessGravatar Dirk Hohndel
Or... this code doesn't do what you think it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Fix missing curly braces that change control flowGravatar Dirk Hohndel
Indentation thankfully is not the same as scope. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21OSTC tools: prevent unknown dc familyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Prevent null dereferenceGravatar Dirk Hohndel
In each case there are scenarios where we would have dereferenced NULL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Prevent possible null pointer dereferenceGravatar Dirk Hohndel
Neither of these functions should ever be called with dc == NULL. But it's easy to prevent the potential crash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Initialize variable to avoid false positive in coverityGravatar Dirk Hohndel
We now that plotInfo.nr will always be positive. Still, this is cheap and shuts up the "defect". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Cylinder model: fix an obscure case that would access cylinder -1Gravatar Dirk Hohndel
If we remove a cylidner for a unique gas and that is allowable, then don't try to copy from cylinder with index same_gas (which is still -1). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Prevent theoretical out of bounds accessGravatar Dirk Hohndel
When I stare at the code enough I can convince myself that cylinderindex will always be assigned a sane value, but on the flip side, making sure nothing stupid happens is cheap insurance. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Fix a number of resource leaksGravatar Dirk Hohndel
Free memory returned from parse_mkvi_value() Free memory returned from printGPSCoords() Free memory allocated in added_list and removed_list Free memory allocated when adding suffix to dive site name Free memory allocated in cache_deco_state() Free memory allocated in build_filename() Free memory allocated in get_utf8() Free memory allocated in alloc_dive() Free memory allocated as cache but never used Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Fix missing return statementGravatar Dirk Hohndel
Returning 0 implies success. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Fix incorrect buffer length calculationGravatar Dirk Hohndel
Oops, this is bad as it will lead to a certain buffer overrun. The other change is more cosmetic - nested open comment '/*'. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Some file dialogs insist on adding a default extensionGravatar Dirk Hohndel
We already had code to deal with this in the Save As case, but similar handling is needed in the Open case. This commit also makes the regular expression handling a bit stricter and identical between the two cases. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Planner: change timestep to 2 secondsGravatar Rick Walsh
Change the timestep used to calculate tissue pressures and ascents from 3 seconds to 2 seconds. But whats wrong with using 3 seconds? Deco stops are at 3 m (10') intervals, and our ascent rate is usually 9 m/min (30'/min), or at least multiples of 3 m/min (10'/min). Hence time to ascend from one stop to the next stop is 20s (or any factor of 60). Using 3s increments, we round our ascent interval up to 21 s, which leads to messy durations and runtimes. But what about me? I like SI units and whole decimals. Don't worry, 2s timesteps fit nicely when using 10 m/min ascent rate (18 s between stops). [Dirk Hohndel: edited the commit message to fix minute/second confusion] Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Restructure preferences dialog so it fits on smaller screens againGravatar Dirk Hohndel
Designer is such a pain to work with. Once I ended up editing the .ui file by hand for the hard stuff and then just use designer to get it consistently formated. Such a disappointment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21HTML export: need to work harder to find the picturesGravatar Dirk Hohndel
Simply looking at the filename in the picture structure isn't enough (now, arguably one might say that it should be and that that data structure should be updated, but that's not how other parts of Subsurface have implemented things so I don't want to break that assumption here). So instead we look up where the pictures actually was loaded from and then copy that file into the right location. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Git storage: implement picture loading from gitGravatar Dirk Hohndel
The interesting challenge here is what to do with the picture data stored in the git repository. If the pictures are already in the file system (for example because Subsurface is runnin on the same machine that this data file was saved on) it would be silly to extract them again every time the dive log is opened. So instead we try to figure out if the pictures can be located and only create local copies of them if that isn't the case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Cmake support: the printer files are part of the UIGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Add helper function to return local filename of picture as C stringGravatar Dirk Hohndel
This way we can actually find the picture that we are showing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Git storage: store pictures in the repositoryGravatar Dirk Hohndel
In order to be able to see pictures when using cloud storage from different machines, we really need to store the pictures with the dive data. This could be made optional with a preference, but for now I'll just enable it by default. Loading the pictures from git still needs to be implemented. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Make helper function deal with files that don't existGravatar Dirk Hohndel
Ignoring when you can't open a file and happily hashing its contents seems wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Move helper declarations into a better header fileGravatar Dirk Hohndel
This way the helpers can be more easily used by other modules. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Git storage: replaces colons with equal in picture offsetGravatar Dirk Hohndel
I found another place where we had colons in file names... This fixes a small cut and paste error in an error message as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21CMake support: turn building for mobile into an optionGravatar Dirk Hohndel
This way it can be easily turned on and off from ccmake. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Cmake support: fix typoGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Planner - end deco stops at whole minutes of runtimeGravatar Rick Walsh
--20cf303ddd3893b1500518e9204e Content-Type: text/plain; charset=UTF-8 Use an adjusted timestep to calculate length of deco stops, so that they always end at whole minutes of runtime. This makes for a cleaner ascent profile. <div dir="ltr">Use an adjusted timestep to calculate length of deco stops, so that they always end at whole minutes of runtime.  This makes for a cleaner ascent profile.<br></div> From 15e08450252f304fc7d46931e2aca5c991c2f3de Mon Sep 17 00:00:00 2001 From: Rick Walsh <rickmwalsh@gmail.com> Date: Sat, 20 Jun 2015 11:36:07 +1000 Subject: [PATCH 2/2] Planner - end deco stops at whole minutes of runtime Use an adjusted timestep to calculate length of deco stops, so that they always end at whole minutes of runtime. This makes for a cleaner ascent profile. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Rename dive class to avoid conflictGravatar Grace Karanja
Rename the Dive class in divelistmodel.h to a void a conflict with the Dive class in templatelayout.h Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Display more detailsGravatar Grace Karanja
Show more dive info in the extended view of the dive. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Add more dive details to the DiveListModelGravatar Grace Karanja
Add some more details to the model. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Fix bug where dives are shown twiceGravatar Grace Karanja
On the QML page, dives are repeated. Adding process_dives to QMLManager after calling parse_file solves this. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Group dives by tripsGravatar Grace Karanja
Group dives according to the allocated dive trips. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Show dive details when a dive is clickedGravatar Grace Karanja
When a dive is clicked, show the dive details on the QML page. This contains basic details, and will be expanded further. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Add TextButton.qml fileGravatar Grace Karanja
This file contains a styled button for use in QML Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Add dive notes to the divelistmodelGravatar Grace Karanja
Add the dive notes field into the DiveListModel class. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Group dives by locationGravatar Grace Karanja
Group dives on the QML page by location. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Better theme for dive list viewGravatar Grace Karanja
Set a rounded blue rectangle on the selected item. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Add DiveListModelGravatar Grace Karanja
This model will be used to show the dives in QML. This commit adds the model, and the means to link it to QML. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>