@@ -165,9 +165,11 @@ namespace WeatherShowFunctions {
165
165
} return - 1 ;
166
166
}
167
167
168
- private string [] get_matches (string lookfor , string dir ) {
168
+ private string [] get_matches (string lookfor ) {
169
169
// find matching cities
170
- File datasrc = File . new_for_path(dir. concat(" /cities" ));
170
+ string citiesfile = GLib . Path . build_filename(Config . WEATHERSHOW_DATADIR , " cities" );
171
+ File datasrc = File . new_for_path(citiesfile);
172
+
171
173
string fixed = lookfor. down(). to_ascii();
172
174
try {
173
175
var dis = new DataInputStream (datasrc. read ());
@@ -990,9 +992,7 @@ namespace WeatherShowApplet {
990
992
private string set_initialcity () {
991
993
// on opening settings, set the gui to the current value
992
994
string initial_citycode = citycode;
993
- string [] initline = WeatherShowFunctions . get_matches(
994
- initial_citycode, moduledir
995
- );
995
+ string [] initline = WeatherShowFunctions . get_matches(initial_citycode);
996
996
// fix for change of cityfile (!)
997
997
if (initline. length == 0 ) {
998
998
citycode = " 2643743" ;
@@ -1084,9 +1084,7 @@ namespace WeatherShowApplet {
1084
1084
edit_citymenu == true &&
1085
1085
entry != null
1086
1086
) {
1087
- string [] matches = WeatherShowFunctions . get_matches(
1088
- currentry, moduledir
1089
- );
1087
+ string [] matches = WeatherShowFunctions . get_matches(currentry);
1090
1088
int n_matches = matches. length;
1091
1089
if (n_matches > 0 ) {
1092
1090
foreach (string s in matches) {
@@ -1507,7 +1505,7 @@ namespace WeatherShowApplet {
1507
1505
1508
1506
private void get_icondata () {
1509
1507
// fetch the icon list
1510
- string icondir = moduledir . concat( " / weather_icons" );
1508
+ string icondir = GLib . Path . build_filename( Config . WEATHERSHOW_DATADIR , " weather_icons" );
1511
1509
iconnames = {}; iconpixbufs = {}; iconpixbufs_large = {};
1512
1510
try {
1513
1511
var dr = Dir . open(icondir);
0 commit comments