* This should never be called with a NULL dive.
* The dc variable was set then never used.
* We now have a unique id for each dive, but we can't simply not
repopulate the model in setDive as the old comment might make you
consider, as otherwise the dataModel will reference already freed data
in pInfo.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We carefully extracted the first dive passed in with the QList, but then
always used current_dive. That's silly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Those items have parent(), which means that when the parent has a scene,
they are automatically added and removed from the scene.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Background was not correctly back to it's original position
and a few other items kept their visibility when it shouldn't.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch does a few things:
1 - reset the model when user closes the dive file
2 - connects the 'rowsAboutToBeRemoved' in a way that the graphics can
remove their polygons too
3 - adds a 'clear' virtual method so items that don't follow the rules can
clean themseves up.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If readfile fails it already frees its buffer.
If the parsing failed we shouldn't use the data in the structure.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Allow subsurface to show the dive planner in case a compile flag is given.
qmake CONFIG+=planner
Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The return value(structure) was not fully initialized, thus random data
returned for uninitialized members possibly causing random bahavior.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
But in general we should not show the profile of a dive that
was recently removed from the list - e.g. via File->Close.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The profile info was generated using nasty string concatenation that the
membuffers are much better at anyway. And membuffers don't need those
arbitrarily sized fixed buffers (500 bytes? Why 500 bytes?).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The "size" member was confusing - it's the size of the allocation, not
the size of the current string. The size of the current string is the
member called "used".
This naming makes perfect sense for the internal implementation, but
it's confusing to users who actually do want to get the size of the
resulting string at the end.
So rename the fields to "alloc" and "len" - which is pretty clear.
This also adds a helper function to strip whitespace from the end:
"strip_mb()".
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
libdivecomputer already supports this, but we didn't save it.
Tested-by: Oscar Isoz <jan.oscar.isoz@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Add missing variable members to the initializer lists.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Add missing variable members to the initializer lists.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Add missing variable members to the initializer lists.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Move variable members construction to the initializer lists.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Initialize every ToolTipItem variable member in initialize list.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Add colorIndex to initialize list.
* Reorder initialize to correct order.
Note: colorIndex initialize value is set too SAC_DEFAULT. I do not know
what is the rigth value since this variable member is not used anywhere.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Initialize/construct all variable members in constructor list.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Add missing improvements::diveId variable member to the initialize list.
* Cleanup DivePlotDataModel::pInfo structure instead only one member.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Initialize variable members in DiveCartesianAxis class.
Note: Initialized values I put needs to be doublechecked.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Initialize DivelogsDeWebServices::uploadMode in initialize list, instead
of constructor body expression.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* Change 'searchBox' member type from 'QLineEdit *' to 'QLineEdit'
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
All of these are now set from the toolbar next to the new profile. This
removes functionality for people using the old profile, but as we will rip
that out and switch to the new profile, soon, that seems an acceptable
side effect.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Load all the settings in the PreferenceDialog constructor. Previously
all the settings were overwritten with default values the first time
PreferencesDialog::syncSettings() was called.
Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Main change is that now SubsurfaceAbout doesn't have instance object, but
it constructs and destructs dynamically.
* Remove the static SubsurfaceAbout::instance() class member
* construct/destruct about dialog on demand
* Other small aboutbox cleanups.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
ACK-ed-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ancient code that was unused and only adding complexity to the
DiveCartesianAxis.
Also remove the spacing between the text and the lines of the Axis.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch re-enables a few items on the profile, most notably, the
profile itself.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Comment out most of the items on the profile since they are
currently completely broken ( positioning, etc ).
Also, remove the settingsChanged stuff from the DepthAxis because it
doesn't have the shrinked / expanded size on it ( it sits on the profile
code ) so I'll most probably move that to the profile settingsChanged in
the future - or if anyone knows of a better place to have this, I'm all
ears.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>