Skip to content

Commit 1f1babb

Browse files
Update search paths
1 parent 0238091 commit 1f1babb

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

birdfont/GtkWindow.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2012s 2013 2014 Johan Mattsson
2+
Copyright (C) 2012 2013 2014 Johan Mattsson
33
44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by

libbirdfont/SearchPaths.vala

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,63 +36,80 @@ public class SearchPaths {
3636
string bundle_path = (BirdFont.bundle_path != null) ? (!) BirdFont.bundle_path : "";
3737

3838
resources = (is_null (resources_folder)) ? "" : resources_folder;
39+
40+
string? current_program = GLib.FileUtils.read_link ("/proc/self/exe");
41+
42+
if (current_program != null) {
43+
string program = (!) current_program;
44+
int separator = program.last_index_of ("/");
45+
46+
if (separator > -1) {
47+
string folder = program.substring (0, separator);
48+
49+
f = get_file (folder + "/../" + d + "/", name);
50+
if (f.query_exists ()) return f;
51+
52+
f = get_file (folder + "/../", name);
53+
if (f.query_exists ()) return f;
54+
}
55+
}
3956

4057
f = get_file (resources + "/" + d + "/", name);
41-
if (likely (f.query_exists ())) return f;
58+
if (f.query_exists ()) return f;
4259

4360
f = get_file (resources + "/", name);
44-
if (likely (f.query_exists ())) return f;
61+
if (f.query_exists ()) return f;
4562

4663
f = get_file ("resources/", name);
47-
if (likely (f.query_exists ())) return f;
64+
if (f.query_exists ()) return f;
4865

4966
f = get_file (resources + "/", name + "/");
50-
if (likely (f.query_exists ())) return f;
67+
if (f.query_exists ()) return f;
5168

5269
f = get_file (BirdFont.exec_path + "/" + d + "/", name);
53-
if (likely (f.query_exists ())) return f;
70+
if (f.query_exists ()) return f;
5471

5572
f = get_file (BirdFont.exec_path + "/", name + "/");
56-
if (likely (f.query_exists ())) return f;
73+
if (f.query_exists ()) return f;
5774

5875
f = get_file (BirdFont.exec_path + "\\" + d + "\\", name);
59-
if (likely (f.query_exists ())) return f;
76+
if (f.query_exists ()) return f;
6077

6178
f = get_file (BirdFont.exec_path + "\\", name + "\\");
62-
if (likely (f.query_exists ())) return f;
79+
if (f.query_exists ()) return f;
6380

6481
f = get_file (bundle_path + "/Contents/Resources/birdfont_resources/", d + "/" + name);
65-
if (likely (f.query_exists ())) return f;
82+
if (f.query_exists ()) return f;
6683

6784
f = get_file (bundle_path + "/Contents/Resources/birdfont_resources/", name + "/");
68-
if (likely (f.query_exists ())) return f;
85+
if (f.query_exists ()) return f;
6986

7087
f = get_file ("./" + d + "/", name);
71-
if (likely (f.query_exists ())) return f;
88+
if (f.query_exists ()) return f;
7289

7390
f = get_file ("../" + d + "/", name);
74-
if (likely (f.query_exists ())) return f;
91+
if (f.query_exists ()) return f;
7592

7693
f = get_file (".\\" + d + "\\", name);
77-
if (likely (f.query_exists ())) return f;
94+
if (f.query_exists ()) return f;
7895

7996
f = get_file ("", name);
80-
if (likely (f.query_exists ())) return f;
97+
if (f.query_exists ()) return f;
8198

8299
f = get_file (d + "\\", name);
83-
if (likely (f.query_exists ())) return f;
100+
if (f.query_exists ()) return f;
84101

85102
f = get_file (@"$PREFIX/share/birdfont/" + d + "/", name);
86-
if (likely (f.query_exists ())) return f;
103+
if (f.query_exists ()) return f;
87104

88105
f = get_file (@"/usr/local/share/birdfont/" + d + "/", name);
89-
if (likely (f.query_exists ())) return f;
106+
if (f.query_exists ()) return f;
90107

91108
f = get_file (@"resources/linux/", name);
92-
if (likely (f.query_exists ())) return f;
109+
if (f.query_exists ()) return f;
93110

94111
f = get_file (@"/usr/share/birdfont/" + d + "/", name);
95-
if (likely (f.query_exists ())) return f;
112+
if (f.query_exists ()) return f;
96113

97114
return f;
98115
}

scripts/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Lesser General Public License for more details.
1414
"""
1515

16-
VERSION = '2.28.0'
16+
VERSION = '2.29.0'
1717
SO_VERSION_MAJOR = '36'
1818
SO_VERSION_MINOR = '0'
1919
SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR

0 commit comments

Comments
 (0)