diff options
author | Jiri Vanek <[email protected]> | 2013-10-23 17:52:18 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-10-23 17:52:18 +0200 |
commit | d124f6a22bbc74de7b95890642615cdf3eaa5029 (patch) | |
tree | 98e17951e49d6a45f8e73bfee6eeb71e853df111 /plugin/icedteanp | |
parent | 2242e242bb2da682cf13c0c4d866f64a68f03691 (diff) |
C-part of plugin is now also trying to follow XDG
* plugin/icedteanp/IcedTeaParseProperties.cc: (user_properties_file) is now using XDG cached dir or its default variant in case that old file do not (should not!) exists
Diffstat (limited to 'plugin/icedteanp')
-rw-r--r-- | plugin/icedteanp/IcedTeaParseProperties.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugin/icedteanp/IcedTeaParseProperties.cc b/plugin/icedteanp/IcedTeaParseProperties.cc index 7203d79..e9d9b63 100644 --- a/plugin/icedteanp/IcedTeaParseProperties.cc +++ b/plugin/icedteanp/IcedTeaParseProperties.cc @@ -105,7 +105,20 @@ bool starts_with(string c1, string c2){ string user_properties_file(){ int myuid = getuid(); struct passwd *mypasswd = getpwuid(myuid); - return string(mypasswd->pw_dir)+"/.icedtea/"+default_file_ITW_deploy_props_name; + // try pre 1.5 file location + string old_name = string(mypasswd->pw_dir)+"/.icedtea/"+default_file_ITW_deploy_props_name; + //exists? then itw was not yet migrated. Use it + if (IcedTeaPluginUtilities::file_exists(old_name)) { + PLUGIN_ERROR("IcedTea-Web plugin is using out-dated configuration"); + return old_name; + } + //we are probably on XDG specification now + //is specified custom value? + if (getenv ("XDG_CONFIG_HOME") != NULL){ + return string(getenv ("XDG_CONFIG_HOME"))+"/icedtea-web/"+default_file_ITW_deploy_props_name; + } + //if not then use default + return string(mypasswd->pw_dir)+"/.config/icedtea-web/"+default_file_ITW_deploy_props_name; } |