More multi-edit fixes

This time for values that aren't simply text.
For normal integers this is rather straight forward. For the 'when'
timestamp we simply assume that this is a shift in time.

What is still missing is consistent handling of the three fields that are
implemented as tags: tags, buddy and divemaster. We have special code for
tags that makes no sense in a multi-edit scenario. And we treat divemaster
and buddy as a single string - which kinda works but treats "Bill, Joe"
and "Joe, Bill" as different.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simplify string comparison

This is based on Linus' idea on the mailing list.
Treat NULL strings and empty strings as identical.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Revert "Save latitude and longitude on XML even if location not set"

This fixes the bug in #440 by accident, and introduces lots of empty
attributes and tags in the xml.

This reverts commit 6378bfd91ee6c0ad746b072d8a9389e0eba7c614.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Terminate the string before relying on strlen

Its a c-string we put, so it must be null-terminated.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt turns edited locations into null-strings

They aren't null pointers after you touched them, so we can't rely on
that to choose if we should use put_string or show_utf8.
show_utf8 would not print the tag if it only contains a \0 as body.

Fixes #440

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
User manual: Updates regarding the companion app

These adiitions and changes were made in accordance with the screenshots
provided by Venkatesh and Salvador and after managing to actually run the
companion app on my phone. Large parts of the text of this section have
been changed in accordance with the Companion V2 interface. Two graphics
were changed.

After Version 2 has stabilised, some more adaptation of the text will be
required.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove trailing spaces from the produced output

The code found the trailing spaces and just didn't care about it.

This also removes the FIXME quoting, because quoting is managed.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manually implement strndup

Mac and Windows don't appear to have that function, so just implement the
poor man's version by hand.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>