From 845148d8c29c3cc452ca380cb3fec9e231ab114d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jerna=C5=9B?= Date: Sat, 12 Jun 2010 18:01:22 +0200 Subject: [PATCH 1/2] Use XDG_CACHE_HOME for avatar cache Be nice with regard to XDG Base Directory Specification at http://standards.freedesktop.org/basedir-spec/latest/ --- SparkleShare/SparklePaths.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/SparkleShare/SparklePaths.cs b/SparkleShare/SparklePaths.cs index b8d78474..30a89bc5 100644 --- a/SparkleShare/SparklePaths.cs +++ b/SparkleShare/SparklePaths.cs @@ -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"); From adb738d4347e64d35b7b1c2b03f98dd178b78500 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 12 Jun 2010 17:29:32 +0100 Subject: [PATCH 2/2] update coding style --- SparkleShare/SparklePaths.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/SparkleShare/SparklePaths.cs b/SparkleShare/SparklePaths.cs index 30a89bc5..40e2c96d 100644 --- a/SparkleShare/SparklePaths.cs +++ b/SparkleShare/SparklePaths.cs @@ -40,12 +40,16 @@ namespace SparkleShare { public static string SparkleAvatarPath { get { - string XDG_CACHE_HOME = Environment.GetEnvironmentVariable("XDG_CACHE_HOME"); - if (XDG_CACHE_HOME != null) { + + 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"); - } + else + return SparkleHelpers.CombineMore + (HomePath, ".cache", "sparkleshare"); + } }