68 |
|
|
69 |
/* ------ set useful defaults ------- */ |
/* ------ set useful defaults ------- */ |
70 |
|
|
71 |
|
char *p = NULL; |
72 |
#ifdef USE_HILDON |
#ifdef USE_HILDON |
73 |
char *p; |
/* try to use internal memory card on hildon/maemo */ |
74 |
settings->base_path = strdup(BASE_DIR); |
p = getenv("INTERNAL_MMC_MOUNTPOINT"); |
75 |
#else |
if(!p) |
|
char *p = getenv("HOME"); |
|
|
g_assert(p); |
|
|
|
|
|
/* build image path in home directory */ |
|
|
settings->base_path = |
|
|
malloc(strlen(p)+strlen(BASE_DIR)+2); |
|
|
strcpy(settings->base_path, p); |
|
|
if(settings->base_path[strlen(settings->base_path)-1] != '/') |
|
|
strcat(settings->base_path, "/"); |
|
|
strcat(settings->base_path, BASE_DIR); |
|
76 |
#endif |
#endif |
77 |
|
p = getenv("HOME"); |
78 |
|
|
79 |
|
/* if everthing fails use tmp dir */ |
80 |
|
if(!p) p = "/tmp"; |
81 |
|
|
82 |
|
/* build image path in home directory */ |
83 |
|
if(strncmp(p, "/home", 5) == 0) |
84 |
|
settings->base_path = g_strdup_printf("%s/.osm2go/", p); |
85 |
|
else |
86 |
|
settings->base_path = g_strdup_printf("%s/osm2go/", p); |
87 |
|
|
88 |
|
fprintf(stderr, "base_path = %s\n", settings->base_path); |
89 |
|
|
90 |
/* ------------- setup download defaults -------------------- */ |
/* ------------- setup download defaults -------------------- */ |
91 |
settings->server = strdup("http://api.openstreetmap.org/api/0.6"); |
settings->server = strdup("http://api.openstreetmap.org/api/0.6"); |