84 |
{ "goto_dss", STORE_BOOL, OFFSET(goto_disable_screensaver) }, |
{ "goto_dss", STORE_BOOL, OFFSET(goto_disable_screensaver) }, |
85 |
{ "cachelist_update", STORE_BOOL, OFFSET(cachelist_update) }, |
{ "cachelist_update", STORE_BOOL, OFFSET(cachelist_update) }, |
86 |
#endif |
#endif |
87 |
|
#ifdef ENABLE_OSM_GPS_MAP |
88 |
|
{ "map_lat", STORE_FLOAT, OFFSET(map.pos.lat) }, |
89 |
|
{ "map_lon", STORE_FLOAT, OFFSET(map.pos.lon) }, |
90 |
|
{ "map_zoom", STORE_INT, OFFSET(map.zoom) }, |
91 |
|
{ "map_source", STORE_INT, OFFSET(map.source) }, |
92 |
|
#endif |
93 |
{ NULL, -1, -1 } |
{ NULL, -1, -1 } |
94 |
}; |
}; |
95 |
|
|
217 |
char str[128]; |
char str[128]; |
218 |
snprintf(str, sizeof(str), GCONF_KEY_GPX, i); |
snprintf(str, sizeof(str), GCONF_KEY_GPX, i); |
219 |
char *fname = gconf_client_get_string(appdata->gconf_client, str, NULL); |
char *fname = gconf_client_get_string(appdata->gconf_client, str, NULL); |
|
|
|
220 |
if(fname) { |
if(fname) { |
221 |
/* check if there's a valid name stored for this file. */ |
/* check if there's a valid name stored for this file. */ |
222 |
/* if yes it's a "closed" file */ |
/* if yes it's a "closed" file */ |
232 |
else |
else |
233 |
*gpx = gpx_parse(dialog, fname); |
*gpx = gpx_parse(dialog, fname); |
234 |
|
|
235 |
free(fname); |
if(!*gpx) { |
236 |
|
/* restoring the gpx file failed, mark it as unusable, but save */ |
237 |
|
/* its presence for later use */ |
238 |
|
|
239 |
|
/* create "closed" entry to remember this file for next */ |
240 |
|
/* load attempt */ |
241 |
|
*gpx = g_new0(gpx_t, 1); |
242 |
|
(*gpx)->filename = fname; |
243 |
|
char *p = fname; |
244 |
|
if(strrchr(fname, '/')) |
245 |
|
p = strrchr(fname, '/')+1; |
246 |
|
|
247 |
|
(*gpx)->name = g_strdup_printf(_("Failed to load: %s"), p); |
248 |
|
(*gpx)->closed = TRUE; |
249 |
|
} else |
250 |
|
free(fname); |
251 |
} |
} |
|
} |
|
|
|
|
|
/* use next gpx entry of this was loaded successfully */ |
|
|
if(*gpx) |
|
252 |
gpx = &((*gpx)->next); |
gpx = &((*gpx)->next); |
253 |
|
} |
254 |
} |
} |
255 |
|
|
256 |
gpx_busy_dialog_destroy(dialog); |
gpx_busy_dialog_destroy(dialog); |
342 |
#endif |
#endif |
343 |
appdata->image_path = strdup(DEFAULT_IMAGE_PATH); |
appdata->image_path = strdup(DEFAULT_IMAGE_PATH); |
344 |
|
|
345 |
|
/* check if this path is actually accessible */ |
346 |
|
/* and change it to the current users home if not */ |
347 |
|
/* (this should only happen on scratchbox) */ |
348 |
|
if(!g_file_test(appdata->image_path, G_FILE_TEST_IS_DIR)) { |
349 |
|
if(g_mkdir_with_parents(appdata->image_path, 0700) != 0) { |
350 |
|
char *p = getenv("HOME"); |
351 |
|
if(!p) p = "/tmp/"; |
352 |
|
|
353 |
|
appdata->image_path = |
354 |
|
g_strdup_printf("%s%s%s", p, |
355 |
|
(p[strlen(p)-1]!='/')?"/":"", |
356 |
|
DEFAULT_IMAGE_PATH_HOME); |
357 |
|
printf("using alt path %s\n", appdata->image_path); |
358 |
|
} |
359 |
|
} |
360 |
|
|
361 |
} else { |
} else { |
362 |
/* some versions old versions messed up the path */ |
/* some versions old versions messed up the path */ |
363 |
if(appdata->image_path[strlen(appdata->image_path)-1] != '/') { |
if(appdata->image_path[strlen(appdata->image_path)-1] != '/') { |