From 5573a60df4a1ce8c136fd4e341b67cde060ab6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jerna=C5=9B?= Date: Fri, 18 Jun 2010 13:45:36 +0200 Subject: [PATCH] Grab the icon path from configure via Defines --- SparkleShare/SparklePaths.cs | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 SparkleShare/SparklePaths.cs diff --git a/SparkleShare/SparklePaths.cs b/SparkleShare/SparklePaths.cs new file mode 100644 index 00000000..1db4f35d --- /dev/null +++ b/SparkleShare/SparklePaths.cs @@ -0,0 +1,57 @@ +// SparkleShare, an instant update workflow to Git. +// Copyright (C) 2010 Hylke Bons +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +using Mono.Unix; +using System; +using System.IO; + +namespace SparkleShare { + + public static class SparklePaths + { + + private static UnixUserInfo UnixUserInfo = new UnixUserInfo (UnixEnvironment.UserName); + + public static string HomePath = UnixUserInfo.HomeDirectory; + + public static string SparklePath = Path.Combine (HomePath ,"SparkleShare"); + + public static string SparkleTmpPath = Path.Combine (SparklePath, ".tmp"); + + public static string SparkleConfigPath = SparkleHelpers.CombineMore (HomePath, ".config", "sparkleshare"); + + public static string SparkleInstallPath = SparkleHelpers.CombineMore (Defines.PREFIX, + "sparkleshare", "icons", "hicolor"); + + 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"); + + } + +}