summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-12-12Kill the use of CSS - Fixes a Lot of issues on dark color schemes.Gravatar Tomaz Canabrava
The css was done by me in the first days of subsurface for Qt, and it was a code that I was never proud of. Mostly because I tougth at the time that it was better to write it into CSS than to create a new class just to take care of the size of the default cell height on a tree view. Now I see that it was a biased approach since it created issues on dark color schemes and it also didn't make a 'native' experience on Gnome or OSX, only on KDE. This fixes that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-12User manual: complete the language preference sectionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-12User manual: add stub for Language PreferencesGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-12User manual: Add section about Profile Pane context menuGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-12User manual: correct typo in Uemis Zurich sectionGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Fix some whitespace damageGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Don't crash on loading tags longer than 127 charsGravatar Anton Lundin
We didn't enforce a limit on tag length, but we would crash on a tag longer than 127 chars. This uses the xml buffer as scratch space. Don't really know if this is fair, but it looks like it works. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Close warning first might be garbageGravatar Anton Lundin
First might be garbage if get_ranges would be called when dive_table.nr == 0. This would rather signal that something else is broken, but at least we shouldn't make it worse. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Don't use old pointer after reallocGravatar Anton Lundin
If realloc moved the memory, we shouldn't try to access it. realloc copied that memory so access it via the new function instead. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Globe: improve the flag placement and sizeGravatar Lubomir I. Ivanov
We can position our old flag in a PNG with double the size of the original flag - 48x48px, so that the pin is exactly at the center of the PNG. This way when the user clicks on a map location the pin should be placed exactly there. Patch also makes the flag bigger. Fixes #335. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11downloadfromdivecomputer.h: remove a forward declarationGravatar Lubomir I. Ivanov
The forward declaration of 'struct device_data_t' is not needed as it already comes from '../libdivecomputer.h'. Reported by the program cppcheck. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11uiemis-downloader.c: fix preceding limit checkGravatar Lubomir I. Ivanov
next_segment(): The iterator limit check (i < size - 1) should precede the indexing (buf[i]). Reported by the program cppcheck. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11profilepgrahics.cpp: fix preceding limit checkGravatar Lubomir I. Ivanov
ProfileGraphicsView::plot_depth_profile(): The iterator limit check (i < 7) should precede the indexing (increments[i]). Reported by the program cppcheck. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11divelist.c: Fix possible NULL pointer deref.Gravatar Lubomir I. Ivanov
calculate_cns(): The check if prev_dive is NULL should be before calling prev_dive->when. Reported by the program cppcheck. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11User manual: Fixes one broken italicsGravatar Tim Wootton
Italics marker needed to come after the 's to work properly Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11User manual: added troughs to peaks in profile descriptionGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11User manual: remove ter from below Stats Tab sectionGravatar Tim Wootton
Found the word "ter" below this para, assume it's not supposed to be there. Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Guard against dereferencing undefGravatar Anton Lundin
Introduce some harness in ProfileGraphicsView::plot_one_event, so we detect bad stuff and bail, instead of dereferencing undef pointers. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Fix potential null pointer dereferenceGravatar Anton Lundin
If createTemporaryPlan was called on a empty diveplan. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Add some sanity checksGravatar Anton Lundin
If first sample is not a DC_SAMPLE_TIME, we would have bin dereferencing a null pointer. This might actually never happen, unless we talk to a really weird dc, but this makes the static analyzer happier. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Use delete instead of free() in c++Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Remove extra local variable declarationGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Remove redundant readfile() in parse_csv_fileGravatar Anton Lundin
try_to_xslt_open_csv will read the file, so we don't need to do it before that and leak that memory. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Match sizeof with pointer typeGravatar Anton Lundin
More to get clang-scan to quiet down that for the unlikely event that unsigned int and int is different sizes. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Initialize tissue_toleranceGravatar Anton Lundin
So we can't return garbage. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Remove some dead codeGravatar Anton Lundin
last_pressure is updated a couple of lines later, so no need to do it here. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Plug potential memory leak in try_to_xslt_open_csvGravatar Anton Lundin
Free temp buffer if realloc fails. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Plug potential memory leak in process_raw_bufferGravatar Anton Lundin
Free temporary buffer before returning. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Plug memory leak in duration()Gravatar Anton Lundin
Strdup should be followed by a free()... Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Plug memory leaks in compare_samplesGravatar Anton Lundin
Free temporary buffer before returning. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10User manual: use charge rather than load when referring to batteryGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10User manual: remove imperative not to saveGravatar Tim Wootton
It's ok to save as you go, just not required. Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Divelogs.de: prevent undefined behaviourGravatar Lubomir I. Ivanov
prepare_dives_for_divelogs() did a silly thing, which I was responsible for. When populating 'tempfile' we benefit from QString, but then return a pointer to a local variable (char *) without alocating it on the heap. This resulted in undefined behavior, as we don't know the lifespan of that local memory on the stack. Patch fixes that by using strdup() and freeing the memory when/if needed. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Latest translation updatesGravatar Dirk Hohndel
Amazing progress. Bulgarian, Chinese (Taiwan), Slovak got completed - many other translations added the hand full of new strings that showed up over the last few days. Thanks to all the translators. I only pull these, authorship is tracked at Transifex. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Manual updateGravatar Willem Ferguson
Replaced graphics for Import from Divelogs.de to reflect latest UI schanges. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Fix asciidoc CSS pathGravatar Sergey Starosek
Both JS and CSS resources need to be embedded into HTML Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Usermanual updateGravatar Willem Ferguson
- Print divelog added - Typos corrected. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Reset libdivecomuter import canceled stateGravatar Dirk Hohndel
Once the process got cancelled once we never reset the flag. Fixes #82 Initial-fix-by: Jef Driesen Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Remove some safety stop code in plan()Gravatar Anton Lundin
Some code in plan() left from the gtk days introduced a safety stop in the plan. It created a un-editable diveplanpoint. Fixes #349 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Don't rely on current path when searching for support filesGravatar Dirk Hohndel
The notion of current path changes as we open files in the file system. What we really want is the directory from where Subsurface was started. That covers both the case of Windows and running Subsurface from the install directory. This worked before because all support files were opened before the first user interaction. But opening the manual showed the flaw in the previous logic. Fixes #348 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Pulled latest translationsGravatar Dirk Hohndel
As always, I didn't author these, just did the pull from Transifex. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Fix selection tracking bugGravatar Dirk Hohndel
When trying to remember a newly manually created dive across the sort_table() call I abused the dive->selected flag and didn't clear it out afterwards (most likely thinking "hey, I'm calling selectDive() on this anyway"). This caused the UI code to correctly mark the dive as selected, but when it called down to the C code to keep the internal data structures in sync, that code didn't update amount_selected as it thought this dive had already been selected. And that caused other parts of the code to get confused, which manifested for example in the failed upload to divelogs.de. So this clears out the flag after abusing it to remember a dive. Maybe we should add a 'remembered' flag instead, but for now this fixes the issue. Fixes #351 Initial-fix-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Add the new string introduced in the previous commitGravatar Dirk Hohndel
It gets lost in the noise with all the line number changes, but this introduces only a single new string. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Webservices: make the dialog title more genericGravatar Lubomir I. Ivanov
We use the same dialog for both the Subsurface WS and for the divelogs.de one. Instead of the old title (which suggests download) we can use a more generic one - "Webservice Connection" This makes it easy for us to maintain a dialog that can both upload and download data, while the dialog title is descriptive enough. Fixes #352 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Planner: fix potential assert in clear()Gravatar Lubomir I. Ivanov
If rowCount() is 0 we get an assert: ASSERT: "last >= first" in file kernel/qabstractitemmodel.cpp... To solve that we wrap the beginRemoveRows() call in a bnrach: if (rowCount() > 0) { ... Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Remove some unused variablesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Use implicit zero initialize for the whole array.Gravatar Anton Lundin
Clang yelled about it, and it looks prettier. It also felt kinda strange to explicit initialize the first element to zero and the rest to zero implicit. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Remove possible dual meaning in Divemaster and Buddy.Gravatar Tim Wootton
Pedantic Tim says "Barring waterproof device, most of us won't be entering these fields during the dive." ;-) Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Removes imperative to not save-as-you-go.Gravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Fix another potential crashGravatar Anton Lundin
Initialize diveplan.dp to NULL, so we know that we will bail in drawProfile, when the initial settingsChanged is fired. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>