~ted/indicator-applet/log-to-file

« back to all changes in this revision

Viewing changes to src/applet-main.c

  • Committer: Ted Gould
  • Date: 2010-01-19 21:25:30 UTC
  • Revision ID: ted@gould.cx-20100119212530-zwdifwulej8j26d0
Only make the directory if it doesn't exist.

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
                GFile * file = g_file_new_for_path(filename);
264
264
                g_free(filename);
265
265
 
266
 
                GFile * cachedir = g_file_new_for_path(g_get_user_cache_dir());
267
 
                g_file_make_directory_with_parents(cachedir, NULL, NULL);
 
266
                if (!g_file_test(g_get_user_cache_dir(), G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
 
267
                        GFile * cachedir = g_file_new_for_path(g_get_user_cache_dir());
 
268
                        g_file_make_directory_with_parents(cachedir, NULL, &error);
 
269
 
 
270
                        if (error != NULL) {
 
271
                                g_error("Unable to make directory '%s' for log file: %s", g_get_user_cache_dir(), error->message);
 
272
                                return;
 
273
                        }
 
274
                }
268
275
 
269
276
                log_file = g_file_replace(file,
270
277
                                          NULL, /* entry tag */