summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-02-12Remove external declaration of non-existant global variableGravatar Dirk Hohndel
Just to slightly reduce possible confusion. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Fix variable scope issueGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Fix ATM-vs-bar confusionGravatar Linus Torvalds
SAC should be calculated in relationship to surface pressure, not "1 bar". I also realize that we have a few other cases where we do the same mistake: the partial pressure calculations do things like po2 = o2 / 1000.0 * depth_to_mbar(sample->depth.mm, dive); which is wrong as well - the partial pressure is also relative to standard atmospheric pressures. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Take the on-canvas position into account for DiveCartesianAxis::valueAt()Gravatar Dirk Hohndel
We did this right for posAtValue(), but not for the inverse. Fixes #438 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Update #include statement for QStringListModelGravatar Boris Barbulovski
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Migrate MainTab models(QStringListModel)Gravatar Boris Barbulovski
Migrate MainTab models from static xxxCompletioModel::instance() to private MainTab variable members. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11User manual: small updatesGravatar Willem Ferguson
The section on the main menu descriptions has been changed a little bit to reflect the current menu structure. The section dealing with exprt from other dive software has been changed to appear more user friendly, with three new icons. Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Handle cancel in PreferencesDialog::on_chooseFile_clickedGravatar Patrick Majewski
If I click in the Preferences Dialog on the 3 dots to choose a default file to load and cancel the opening FileDialog an empty string is returned and set to the coresponding QLineEdit. The new behavior (and mostly expected) is to update the QLineEdit only if there is a filename returned from QFileDialog. Signed-off-by: Patrick Majewski <dive@patrick-majewski.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11More renamingGravatar Dirk Hohndel
I don't even know what a partial gas might be... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Give the widget for the new profile a better nameGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11New profile: enable switching between dive computersGravatar Dirk Hohndel
This was mostly in place, just needed to be hooked up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Minor cleanupGravatar Dirk Hohndel
Remove obsolete header and unused variable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Use our macro for FP comparisonsGravatar Dirk Hohndel
I think that catches all the ones we missed (thanks clang -Wfloat-equal). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Fix bug in logic expressionGravatar Dirk Hohndel
Yes, the old code made perfect sense when you read it - except the C++ compiler turned it into something quite different from what was intended. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Clean up include filesGravatar Dirk Hohndel
They should have a newline at the end. Forward declarations of classes should be 'class'. Function / method definitions don't end on a ';' Remove obsolete QStateMachine forward reference. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Don't repopulate the model if the dive didn't changeGravatar Dirk Hohndel
plotDives takes a list of dives (for future use) but currently only looks at the first dive in this list. With that semantic in mind we can save ourselves some work if we first check if this is the same dive we are already showing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Clean up the setDive functionGravatar Dirk Hohndel
* 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>
2014-02-10Set up the dive that was passed in as first diveGravatar Dirk Hohndel
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>
2014-02-10Profile2: Prevent another crash if no dives are presentGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Do not add the items to the scene twice.Gravatar Tomaz Canabrava
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>
2014-02-10Fixed item visibility on emptyState after being on profileState.Gravatar Tomaz Canabrava
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>
2014-02-10Clear the data when the model resets.Gravatar Tomaz Canabrava
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>
2014-02-10Don't ignore the return values from readfile and EXIF parserGravatar Dirk Hohndel
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>
2014-02-10Enable the dive planning under a compile flagGravatar Danilo Cesar Lemes de Paula
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>
2014-02-10Fix calloc parameter order.Gravatar Boris Barbulovski
* Set correct calloc parameters order(num, size) Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Improve sanity check for DivePlotDataModel::data()Gravatar Boris Barbulovski
Adds DivePlotDataModel row upper-boundary check (isValid method already checks for negative values). Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Fix plot_info calculate_max_limits_new() function return valueGravatar Boris Barbulovski
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>
2014-02-10memory leak fix(that I created in some previous commits).Gravatar Boris Barbulovski
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Close search panel by button clickGravatar Sergey Starosek
Connect Close button (X) to panel's hide() method. Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Profile2: Prevent a crash if no dives are presentGravatar Lubomir I. Ivanov
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>
2014-02-10Use 'struct membuffer' for profile info string generationGravatar Linus Torvalds
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>
2014-02-10Clean up membuffer internal structure names, add strip functionGravatar Linus Torvalds
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>
2014-02-10Add support for heartrate and bearing information in samplesGravatar Linus Torvalds
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>
2014-02-09mainwindow.cpp improvementsGravatar Boris Barbulovski
* Add missing variable members to the initializer lists. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09maintab.cpp improvements.Gravatar Boris Barbulovski
* Initialize(lazy) MainTab::multiEditEquipmentPlaceholder struct Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09globe.cpp improvementsGravatar Boris Barbulovski
* Add missing variable members to the initializer lists. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09downloadfromdivecomputer.cpp improvementsGravatar Boris Barbulovski
* Add missing variable members to the initializer lists. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09more diveplanner.cpp improvementsGravatar Boris Barbulovski
* Move variable members construction to the initializer lists. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09diveplanner.cpp improvementsGravatar Boris Barbulovski
* Add missing variable members to the initializer lists. * Add *lazy* structure initializations. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09ProfileWidget2 class improvementsGravatar Boris Barbulovski
* Reorder ProfileWidget2 class constructor initialize list. * Initialize(lazy) ProfileWidget2::plotInfo structure. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09ToolTipItem class improvementsGravatar Boris Barbulovski
* Initialize every ToolTipItem variable member in initialize list. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09DiveTextItem improvementsGravatar Boris Barbulovski
* 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>
2014-02-09diveprofileitem.cpp improvementsGravatar Boris Barbulovski
* Initialize/construct all variable members in constructor list. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09DivePlotDataModel improvementsGravatar Boris Barbulovski
* 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>
2014-02-09Initialize variable members in DiveCartesianAxis class.Gravatar Boris Barbulovski
* 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>
2014-02-09Indent fixGravatar Boris Barbulovski
* Fix tagwidget.h indent. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09DivelogsDeWebServices class cleanupGravatar Boris Barbulovski
* 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>
2014-02-09DiveListView tiny cleanupGravatar Boris Barbulovski
* Change 'searchBox' member type from 'QLineEdit *' to 'QLineEdit' Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09diveplanner.cpp cleanupGravatar Boris Barbulovski
* Add missing DivePlannerPointsModel::tempDive to the constructor initialize list. * ExpanderGraphics class: Construct pointer-variable members into initialize list, Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>