Changeset d4dbd0be in subsurface


Ignore:
Timestamp:
Feb 5, 2017, 11:59:47 AM (5 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
11dcae4
Parents:
6518b0d
git-author:
Joakim Bygdell <j.bygdell@…> (02/04/17 01:13:58)
git-committer:
Dirk Hohndel <dirk@…> (02/05/17 11:59:47)
Message:

Save profile settings to git

In order to streamline the view between desktop and mobile we need to save
selected profile related settings to git.

Signed-off-by: Joakim Bygdell <j.bygdell@…>

Location:
core
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • core/dive.c

    r6518b0d rd4dbd0be  
    34413441}
    34423442
     3443void set_git_prefs(char *prefs)
     3444{
     3445        if (strstr(prefs, "TANKBAR"))
     3446                git_prefs.tankbar = 1;
     3447        if (strstr(prefs, "DCCEILING"))
     3448                git_prefs.dcceiling = 1;
     3449}
     3450
    34433451void average_max_depth(struct diveplan *dive, int *avg_depth, int *max_depth)
    34443452{
  • core/dive.h

    r4a894e0 rd4dbd0be  
    923923extern void set_userid(char *user_id);
    924924extern void set_informational_units(char *units);
     925extern void set_git_prefs(char *prefs);
    925926
    926927extern const char *get_dive_date_c_string(timestamp_t when);
  • core/load-git.c

    r81d5d82 rd4dbd0be  
    817817}
    818818
     819static void parse_settings_prefs(char *line, struct membuffer *str, void *unused)
     820{
     821        (void) str;
     822        (void) unused;
     823        if (line)
     824                set_git_prefs(line);
     825}
     826
    819827/*
    820828 * Our versioning is a joke right now, but this is more of an example of what we
     
    989997#undef D
    990998#define D(x) { #x, parse_settings_ ## x }
    991         D(autogroup), D(divecomputerid), D(subsurface), D(units), D(userid), D(version),
     999        D(autogroup), D(divecomputerid), D(subsurface), D(prefs), D(units), D(userid), D(version)
    9921000};
    9931001
  • core/pref.h

    r9357341 rd4dbd0be  
    174174};
    175175
    176 extern struct preferences prefs, default_prefs, informational_prefs;
     176extern struct preferences prefs, default_prefs, informational_prefs, git_prefs;
    177177
    178178#define PP_GRAPHS_ENABLED (prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe)
  • core/save-git.c

    r7c8073e rd4dbd0be  
    862862        cond_put_format(autogroup, &b, "autogroup\n");
    863863        save_units(&b);
     864        if (prefs.tankbar)
     865                put_string(&b, "prefs TANKBAR\n");
     866        if (prefs.dcceiling)
     867                put_string(&b, "prefs DCCEILING\n");
    864868
    865869        blob_insert(repo, tree, &b, "00-Subsurface");
Note: See TracChangeset for help on using the changeset viewer.