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 */ |
236 |
/* restoring the gpx file failed, mark it as unusable, but save */ |
/* restoring the gpx file failed, mark it as unusable, but save */ |
237 |
/* its presence for later use */ |
/* its presence for later use */ |
238 |
|
|
239 |
/* create fake entry to remember this file for next load attempt */ |
/* create "closed" entry to remember this file for next */ |
240 |
|
/* load attempt */ |
241 |
*gpx = g_new0(gpx_t, 1); |
*gpx = g_new0(gpx_t, 1); |
242 |
(*gpx)->filename = fname; |
(*gpx)->filename = fname; |
243 |
(*gpx)->failed = TRUE; |
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 |
} else |
250 |
free(fname); |
free(fname); |
251 |
} |
} |
252 |
|
gpx = &((*gpx)->next); |
253 |
} |
} |
|
|
|
|
gpx = &((*gpx)->next); |
|
254 |
} |
} |
255 |
|
|
256 |
gpx_busy_dialog_destroy(dialog); |
gpx_busy_dialog_destroy(dialog); |