Diff of /trunk/src/gconf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 34 by harbaum, Wed Jul 29 19:24:15 2009 UTC revision 62 by harbaum, Tue Aug 18 20:33:08 2009 UTC
# Line 84  static store_t store[] = { Line 84  static store_t store[] = {
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    #endif
92    { NULL, -1, -1 }    { NULL, -1, -1 }
93  };  };
94    
# Line 326  void gconf_load_state(appdata_t *appdata Line 330  void gconf_load_state(appdata_t *appdata
330  #endif  #endif
331      appdata->image_path = strdup(DEFAULT_IMAGE_PATH);      appdata->image_path = strdup(DEFAULT_IMAGE_PATH);
332    
333        /* check if this path is actually accessible */
334        /* and change it to the current users home if not */
335        /* (this should only happen on scratchbox) */
336        if(!g_file_test(appdata->image_path, G_FILE_TEST_IS_DIR)) {
337          if(g_mkdir_with_parents(appdata->image_path, 0700) != 0) {
338            char *p = getenv("HOME");
339            if(!p) p = "/tmp/";
340    
341            appdata->image_path =
342              g_strdup_printf("%s%s%s", p,
343                              (p[strlen(p)-1]!='/')?"/":"",
344                              DEFAULT_IMAGE_PATH_HOME);
345            printf("using alt path %s\n", appdata->image_path);
346          }
347        }
348    
349    } else {    } else {
350      /* some versions old versions messed up the path */      /* some versions old versions messed up the path */
351      if(appdata->image_path[strlen(appdata->image_path)-1] != '/') {      if(appdata->image_path[strlen(appdata->image_path)-1] != '/') {

Legend:
Removed from v.34  
changed lines
  Added in v.62