Use XDG_CACHE_HOME for avatar cache

Be nice with regard to XDG Base Directory Specification at
http://standards.freedesktop.org/basedir-spec/latest/
This commit is contained in:
Łukasz Jernaś 2010-06-12 18:01:22 +02:00
parent 232d5c0bb1
commit 845148d8c2

View file

@ -38,8 +38,16 @@ namespace SparkleShare {
SparkleHelpers.CombineMore ("usr", "share", "sparkleshare",
"icons", "hicolor");
public static string SparkleAvatarPath =
Path.Combine (SparkleConfigPath, "avatars");
public static string SparkleAvatarPath {
get {
string XDG_CACHE_HOME = Environment.GetEnvironmentVariable("XDG_CACHE_HOME");
if (XDG_CACHE_HOME != null) {
return Path.Combine (XDG_CACHE_HOME, "sparkleshare");
} else {
return SparkleHelpers.CombineMore (HomePath, ".cache", "sparkleshare");
}
}
}
public static string SparkleIconPath =
SparkleHelpers.CombineMore ("usr", "share", "icons", "hicolor");