Fix theoretical uninitialized read

We should never read cur_pr[cyl] if cyl isn't used during a dive - but for
cylinders that are used cur_pr[cyl] is initialized. But just to catch
errors elsewhere, let's not leave cur_pr[cyl] uninitialized.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix compilation with libgit2 0.20

Linus was wrong - the change to the API happened after 0.20 was released.
So libgit2 0.20 still needs the fix.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix a crash on changing dives when the ruler is used.

The ruler is a weird beast - it has two child objects that access the
parent to call another function, that call the child functions.

When I updated the plot_info I didn't take that into consideration, what
happened is that when I set the parent's plot_info, the children's
plot_info are still invalid, but the update method is called anyhow.

This patch updates all plot_info's before calling anything else.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove the old profile from the main screen of Subsurface

This patch partially removes the code for the old profile from
Subsurface. It removes the use of the old profile on the mainwindow,
but keeping the code in the tree for now.

A bit of code-cleanup also entered this commit because I had to change
every instance of the code that used the old profile.

Now to the real code-cleanup

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

This is simply a code removal, nothing was touched besides the
profilegraphics.h/cpp files.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove a Lot of Dead Code.

This is just removal of dead code from the old profile, probably there's
still a bit more to remove, but this is a very good cleanup already.

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