diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-04-29 06:17:02 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-29 12:14:59 -0700 |
commit | 3f6366026798ebd31cd08af0619049aacfd96e2b (patch) | |
tree | 62a093f4cb82ca08e1bc4a7c8677f2cb1e64aebe /core/subsurfacestartup.c | |
parent | f536da0ee32a39806efdbcbf9ed2edcaaa230f26 (diff) | |
download | subsurface-3f6366026798ebd31cd08af0619049aacfd96e2b.tar.gz |
Allow switching the user from the command line
This is a feature that many people have asked for. This implementation is
somewhat simplistic because we simply use a different name for the
program settings - but interestingly enough this appears to be enough to
capture a lot of the core functionality that people are looking for in
multi-user support.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurfacestartup.c')
-rw-r--r-- | core/subsurfacestartup.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c index 6e0dede1c..bb257960a 100644 --- a/core/subsurfacestartup.c +++ b/core/subsurfacestartup.c @@ -197,6 +197,11 @@ void parse_argument(const char *arg) continue; case '-': /* long options with -- */ + /* first test for --user=bla which allows the use of user specific settings */ + if (strncmp(arg, "--user=", sizeof("--user=") - 1) == 0) { + settings_suffix = strdup(arg + sizeof("--user=") - 1); + return; + } if (strcmp(arg, "--help") == 0) { print_help(); exit(0); @@ -254,8 +259,10 @@ void setup_system_prefs(void) subsurface_OS_pref_setup(); default_prefs.divelist_font = strdup(system_divelist_default_font); default_prefs.font_size = system_divelist_default_font_size; - default_prefs.default_filename = system_default_filename(); +#if !defined(SUBSURFACE_MOBILE) + default_prefs.default_filename = system_default_filename(); +#endif env = getenv("LC_MEASUREMENT"); if (!env) env = getenv("LC_ALL"); |