aboutsummaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
AgeCommit message (Collapse)Author
2013-12-06Correctly parse translated GPS coordinatesGravatar Dirk Hohndel
Minor oversight in commit 917b47b79cb8 ("Parse localized GPS string") - we accepted the translated hemisphere indicators in the regular expression, but then didn't use them later when comparing with the result of applying the regular expression. Fixes #331 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Parse localized GPS stringGravatar Dirk Hohndel
Let's ALWAYS support the somewhat "international standard" N/S/W/E characters, but ALSO support localized versions. Fixes #315 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-26Remember Trip Selection.Gravatar Tomaz Canabrava
This patch remembers the trip selection across the Dive Tree Model. It's a tiny bit big because we used to have a variable 'selected trips' that's now calculed dynamically - this is more future proof. This is a start of Un-cluttering the view ( for 4.1 I hope to reduce the code in this class to nearly a half. ) Fixes #303 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06Trying to switch to Qt translationGravatar Dirk Hohndel
This compiles and looks about right, but it doesn't appear to work, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06Parse GPS text in C++ and re-implement GPS changed checkGravatar Dirk Hohndel
This is SO MUCH easier then the convoluted and fragile C / glib code it replaces. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04Add a helper function to calculate weight display stringGravatar Benjamin
Add a helper function to unify the calculation of the weight display string, instead of having the same calculation in two places in the code. Signed-off-by: Benjamin Fogel <nystire@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-05Fix crash in DiveComputerList::addDC() when importing from DM4.Gravatar Michael Andreen
DiveComputerList::getExact() created a temporary QList with the DiveComputerNodes matching a specific model. A pointer to a node in the list was returned, which becomes invalid when the list goes out of scope and gets destroyed. Causing a crash when the model strings are compared later. Instead of using contains() and creating a temporary list, we can just use an iterator, which should be both faster and safer. The crash is easy to trigger with DM4 imports, but can probably be triggered in other cases too. Similar problem with DiveComputerList::get(). Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Remove unused QMap includeGravatar Henrik Brautaset Aronsen
This sneaked into commit 9364436264638e639c7ef2eb642783fbee6f7ea4. It shouldn't be there. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Fix compilation error in DiveComputerList destructor on MacOSXGravatar Henrik Brautaset Aronsen
The compiler on MacOSX seems stricter than others: qthelper.cpp: In destructor ‘DiveComputerList::~DiveComputerList()’: qthelper.cpp:10: error: expected class-name before ‘(’ token Fixed with help from http://stackoverflow.com/a/14777627/13365 Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Converting the device_info list into a Qt data structureGravatar Dirk Hohndel
This data structure was quite fragile and made 'undo' when editing rather hard to implement. So instead I decided to turn this into a QMultiMap which seemed like the ideal data structure for it. This map holds all the dive computer related data indexed by the model. As QMultiMap it allows multiple entries per key (model string) and disambiguates between them with the deviceId. This commit turned out much larger than I wanted. But I didn't manage to find a clean way to break it up and make the pieces make sense. So this brings back the Ok / Cancel button for the dive computer edit dialog. And it makes those two buttons actually do the right thing (which is what started this whole process). For this to work we simply copy the map to a working copy and do all edits on that one - and then copy that over the 'real' map when we accept the changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>