Rename getDiveById to get_dive_by_id to keep current c code organized.

This commit renames getDiveById to get_dive_by_id, and it also removes the
Q_ASSERTS and if(!dive) return that the callers of this function were
calling. If it has a Q_ASSERT this means that the dive must exist,
so checking for nullness was bogus too. I've changed the assert (done
in a silly C-Way.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-05-12 14:22:46 -03:00 committed by Dirk Hohndel
parent e1971e9425
commit e0c0ac5d5c
5 changed files with 21 additions and 28 deletions

View file

@ -178,9 +178,7 @@ void DivePlotDataModel::emitDataChanged()
void DivePlotDataModel::calculateDecompression()
{
struct dive *d = getDiveById(id());
if (!d)
return;
struct dive *d = get_dive_by_diveid(id());
struct divecomputer *dc = select_dc(d);
init_decompression(d);
calculate_deco_information(d, dc, &pInfo, false);