[chronojump] Fixed GetPrefixDir on mac
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed GetPrefixDir on mac
- Date: Tue, 30 Jun 2020 16:02:21 +0000 (UTC)
commit 33d833b4308a5b8d48093bfc6393b81fffdce4d1
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Jun 30 18:01:35 2020 +0200
Fixed GetPrefixDir on mac
src/util.cs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/util.cs b/src/util.cs
index 4566c234..326dcf29 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1256,7 +1256,14 @@ public class Util
"share" + Path.DirectorySeparatorChar + "doc" + Path.DirectorySeparatorChar +
"chronojump");
}
- public static string GetPrefixDir(){
+ public static string GetPrefixDir()
+ {
+ //on mac with the bundle we use this method to return PrefixDir, as BaseDirectory and
GetCurrentDirectory() do not work
+ if(UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX)
+ return (System.IO.Path.Combine(
+
Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName),
+ ".."));
+
string baseDirectory = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,
"..");
if (! Directory.Exists(Path.Combine(baseDirectory, "lib" + Path.DirectorySeparatorChar +
"chronojump"))) {
baseDirectory = System.IO.Path.Combine(baseDirectory, "..");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]