config: return HomePath enum directly. #705
This commit is contained in:
parent
2768426235
commit
a7884fc1f1
|
@ -39,23 +39,12 @@ namespace SparkleLib {
|
||||||
|
|
||||||
public string HomePath {
|
public string HomePath {
|
||||||
get {
|
get {
|
||||||
if (GetConfigOption ("home_path") != null) {
|
if (GetConfigOption ("home_path") != null)
|
||||||
return GetConfigOption ("home_path");
|
return GetConfigOption ("home_path");
|
||||||
|
else if (SparkleHelpers.IsWindows)
|
||||||
} else if (SparkleHelpers.IsWindows) {
|
return Environment.GetFolderPath (Environment.SpecialFolder.UserProfile);
|
||||||
try {
|
else
|
||||||
Environment.SpecialFolder folder =
|
|
||||||
(Environment.SpecialFolder) Enum.Parse (
|
|
||||||
typeof(Environment.SpecialFolder), "UserProfile");
|
|
||||||
|
|
||||||
return (Environment.GetFolderPath (folder));
|
|
||||||
|
|
||||||
} catch {
|
|
||||||
return Environment.GetFolderPath (Environment.SpecialFolder.Personal);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
return Environment.GetFolderPath (Environment.SpecialFolder.Personal);
|
return Environment.GetFolderPath (Environment.SpecialFolder.Personal);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue