Add option to save userid in data files

The userid of Subsurface Webservice can be included in locally saved xml
files and git repository.
For xml files, it is stored in userid tag. For git repo, it is stored
in 00-Subsurface file present in the repo.
Preference dialog and webservice dialog modified to include option
for saving userid locally.

In case of difference in default userid and userid in local file,
some semantics are followed. These can be referred to here:
http://lists.hohndel.org/pipermail/subsurface/2014-April/011422.html

Fixes #473

Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Venkatesh Shukla 2014-04-11 11:47:35 +05:30 committed by Dirk Hohndel
parent ad9eb73d73
commit 3abcde9a2a
10 changed files with 148 additions and 5 deletions

View file

@ -508,10 +508,13 @@ void save_dives_buffer(struct membuffer *b, const bool select_only)
put_format(b, "<divelog program='subsurface' version='%d'>\n<settings>\n", VERSION);
if (save_userid_local)
put_format(b, " <userid>%s</userid>\n", userid);
/* save the dive computer nicknames, if any */
call_for_each_dc(b, save_one_device);
if (autogroup)
put_format(b, "<autogroup state='1' />\n");
put_format(b, " <autogroup state='1' />\n");
put_format(b, "</settings>\n<dives>\n");
for (trip = dive_trip_list; trip != NULL; trip = trip->next)