Diff of /trunk/src/gconf.c

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

revision 48 by harbaum, Fri Aug 7 07:57:33 2009 UTC revision 62 by harbaum, Tue Aug 18 20:33:08 2009 UTC
# Line 330  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.48  
changed lines
  Added in v.62