diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2011-12-07 20:49:22 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2011-12-07 20:49:22 -0800 |
commit | 52748412fff0974fbc76b3f0a72cd0ba58b37771 (patch) | |
tree | 045c33bb245cb6667c8a7c381eccb8864c03ac93 /save-xml.c | |
parent | af290d5eb281662d336b8186a9df1a489d78ec9d (diff) | |
download | subsurface-52748412fff0974fbc76b3f0a72cd0ba58b37771.tar.gz |
Fix some issues with star rating code
To waste less space in the tree view heading we simply put a star in the
heading instead of "Rating".
We now treat "zero stars" to mean "not rated" and don't store that value
in the XML file.
Rating is no longer a top level tag in the dive entry but instead a
property of the dive tag.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/save-xml.c b/save-xml.c index 80c26b882..c9085db51 100644 --- a/save-xml.c +++ b/save-xml.c @@ -182,7 +182,6 @@ static void save_overview(FILE *f, struct dive *dive) show_location(f, dive); show_utf8(f, dive->divemaster, " <divemaster>","</divemaster>\n"); show_utf8(f, dive->buddy, " <buddy>","</buddy>\n"); - fprintf(f, " <rating>%d</rating>\n", dive->rating); show_utf8(f, dive->notes, " <notes>","</notes>\n"); } @@ -263,6 +262,8 @@ static void save_dive(FILE *f, struct dive *dive) fputs("<dive", f); if (dive->number) fprintf(f, " number='%d'", dive->number); + if (dive->rating) + fprintf(f, " rating='%d'", dive->rating); fprintf(f, " date='%04u-%02u-%02u'", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday); fprintf(f, " time='%02u:%02u:%02u'", |