]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Fix up dive number naming
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Sep 2011 18:36:33 +0000 (11:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Sep 2011 22:49:17 +0000 (15:49 -0700)
Use "dive->number" instead of "dive->nr". And make the XML match too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
dive.h
info.c
parse-xml.c
save-xml.c

diff --git a/dive.h b/dive.h
index 3b5e5abd75a0e9b757aaa2f0582be802a3ebbe40..3ed233ddbc85830d19670926e60f3484b2b15aa2 100644 (file)
--- a/dive.h
+++ b/dive.h
@@ -128,7 +128,7 @@ struct sample {
 #define MAX_CYLINDERS (8)
 
 struct dive {
-       int nr;
+       int number;
        time_t when;
        char *location;
        char *notes;
diff --git a/info.c b/info.c
index 32b830dd883d0b346728e0bcea97e4afd444b103..b65a82081cc51a061326a964a0f3b551368ad43e 100644 (file)
--- a/info.c
+++ b/info.c
@@ -118,8 +118,8 @@ void show_dive_info(struct dive *dive)
        gtk_entry_set_text(location, text);
 
        len = 0;
-       if (dive->nr)
-               len = snprintf(buffer, sizeof(buffer), "%d. ", dive->nr);
+       if (dive->number)
+               len = snprintf(buffer, sizeof(buffer), "%d. ", dive->number);
        snprintf(buffer+len, sizeof(buffer)-len, "%s", text);
        gtk_label_set_text(GTK_LABEL(locationnote), buffer);
 
index a71ff235b4043bef4b9a8c296f3b91721f7e1f68..b5f86fa8043c3d26c63e0d1537a3cbf809d97aab 100644 (file)
@@ -609,8 +609,7 @@ static void divinglog_place(char *place, void *_location)
 
 static int divinglog_dive_match(struct dive *dive, const char *name, int len, char *buf)
 {
-       return  MATCH(".id", get_index, &dive->nr) ||
-               MATCH(".divedate", divedate, &dive->when) ||
+       return  MATCH(".divedate", divedate, &dive->when) ||
                MATCH(".entrytime", divetime, &dive->when) ||
                MATCH(".depth", depth, &dive->maxdepth) ||
                MATCH(".tanksize", cylindersize, &dive->cylinder[0].type.size) ||
@@ -877,7 +876,7 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
                break;
        }
 
-       if (MATCH(".nr", get_index, &dive->nr))
+       if (MATCH(".number", get_index, &dive->number))
                return;
        if (MATCH(".date", divedate, &dive->when))
                return;
index e47092ebcb9d9dee241e08f1a1396446edbcfb21..3ed67fe3972f6d6d788279d1a2e7de0678a17046 100644 (file)
@@ -206,8 +206,8 @@ static void save_dive(FILE *f, struct dive *dive)
        struct tm *tm = gmtime(&dive->when);
 
        fputs("<dive", f);
-       if (dive->nr)
-               fprintf(f, " nr='%d'", dive->nr);
+       if (dive->number)
+               fprintf(f, " number='%d'", dive->number);
        fprintf(f, " date='%04u-%02u-%02u'",
                tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
        fprintf(f, " time='%02u:%02u:%02u'",