Invalid dives

Dirk Hohndel dirk at hohndel.org
Sat Mar 16 15:27:35 PDT 2013


Ďoďo <dodo.sk at gmail.com> writes:

> Folks,
>
> after last diving trip I have in my computer several invalid dives which
> should be removed, but I wanted to keep them hidden somewhere in the
> background.
>
> I did small changes in Subsurface which allows to tag dives as "Invalid".
> Invalid dives are displayed only if it is explicitly allowed in the
> preferences.
>
> Would it be interesting to have it in subsurface?

Why would you want the invalid dives in the datafile at all? Why not
just delete them?

> Attached is the first shot which does:
> - Tagging single dive as invalid
> - Not displaying invalid dives if not allowed
> - Setting in the preferences
> - Saving preferences as well as information about tag in XML file
>
> It does not yet:
> - Tagging multiple dives as invalid
> - After changing preferences it does not update the dive list. So far I am
> restarting subsurface due to my ZERO knowledges about GTK
>
> It is:
> - From graphic point of view ugly because:
>  -- In the preferences the checkbox for invalid dive should be below the
> default XML
>  -- If dives is taged as invalid, there should not be Ybes, but some nice
> graphical element.

The patch is reversed (it tries to remove your new code).
Indentation / code formatting certainly does not follow our style
e.g.:

        if(dive->invalid && ...) continue;

there should be a space after the keyword "if" and continue should be in
the next line...

If you make dive.invalid a gboolean then you can simply write the
callback as 

         dive->invalid = !dive->invalid;

in prefs.h I think the comparison with ">= 0" is wrong.

But this feedback is mostly for learning purposes... I still want to
first understand why you would want that functionality to begin with.

/D


More information about the subsurface mailing list