Correctly set the unselected dive.

The selected dive was being set to zero when the program
started, but zero is actually the first dive. There
were workarounds on the gtk code for that probably

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fixed the loading of some maps

On some maps, the lack of setting up the dc before plotting
the dive-computer nick caused a division by zero, breaking
the correct visualization of the dive.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fix loading a second dive, after the first file was loaded.

This patch fixes loading a second dive-file after the first
one had been loaded. it simply clears some information and
makes sure that the current selected dive is invalid when
the file closes. I also did a bit of code cleanup on this one
to make things simpler in the future.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Search both qmake and qmake-qt4

Some Linux distributions do not ship a "qmake" binary, despite
recommendations from the Qt Project. We need to cope with that, so we
search for qmake-qt4 if qmake fails.

We use "qmake -query QT_VERSION" instead of qmake -v because that is
known to produce an error for Qt 3's qmake.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Get the name of moc,uic,rcc from the .pc files in Qt 4

Just in case some crazy distributions also rename the binaries.

Renaming the binaries is not supported in Qt 5 and should never be
done. Besides, the binary names are missing from Qt 5.0.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>