Move unit related code to units.h

The units are used everywhere in the application, we don't really
need to include "dive.h" to be able to use unit conversion, so I
changed them to a new file. There is still a lot of non-dive stuff
in dive.h / c, I'll try to move more later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove old defines.

Those were from the ancient Gtk times where we hardcoded the white stars
and black stars as font glyphs instead of drawing them. get rid of it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correct the usage of std::string and QString

QStrings shouldn't be == "" to check for empty string, use .isEmpty()
QStrings shouldn't be != "" to check for non empty, use .size()
std::string shouldn't be cleared with = "", use .clear()

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simplify code.

this is not necessary when you don't have a variable
that has the exact same name as the 'this->variable' name,

also, there's no need to check if a QString is empty
before trying to use the == on them.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
'Class' string is unecessary when using a Container.

pretty self explanatory, the 'class' keyword is unecessary
when defining things inside a Container, be it a QList,
QVector, QMap, QHahs or anything else.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When creating methods that pass QString, use const QString&

This removes unecessary creation and destruction of the object
making the code shine a bit more and be more fluffy. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
use for_each_dive instead of hand-written loop.

It's easyer to make a mistake in the loop insteaf of
using the currently correct one that's already written

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Prefix a method with 'dive_' because it should work only with dives

I'll probably add prefixes to functions to make it easier to find method
via autocomplete from the grep or interface helpers, do you wanna know all
the functions that works with a dive?  ask for the completion for dive_,
do you wanna know all the functions that works with a divelist? ask for
the completions on divelist_ or run grep -rIs divelist_ on the header
files.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Documentation spelling errors

A general review of the documentation has found more spelling errors.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>