]> www.fi.muni.cz Git - evince.git/blobdiff - libdocument/ev-file-helpers.c
Using g_mkdir_with_parents() instead of g_mkdir() to really ensure the
[evince.git] / libdocument / ev-file-helpers.c
index d9b6448418b1739e33196265d76a37f433e5cb89..82e854336ec90793d0f15eb60cd61dab65848bda 100644 (file)
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-xfer.h>
+
+#if WITH_GNOME
 #include <libgnome/gnome-init.h>
+#endif
 
 #include "ev-file-helpers.h"
 
@@ -47,7 +50,7 @@ ensure_dir_exists (const char *dir)
        if (g_file_test (dir, G_FILE_TEST_IS_DIR))
                return TRUE;
        
-       if (g_mkdir (dir, 488) == 0)
+       if (g_mkdir_with_parents (dir, 488) == 0)
                return TRUE;
 
        if (errno == EEXIST)
@@ -63,9 +66,15 @@ ev_dot_dir (void)
        if (dot_dir == NULL) {
                gboolean exists;
 
+#if WITH_GNOME
                dot_dir = g_build_filename (gnome_user_dir_get (),
                                            "evince",
                                            NULL);
+#else
+               dot_dir = g_build_filename (g_get_user_config_dir (),
+                                           "evince",
+                                           NULL);
+#endif
 
                exists = ensure_dir_exists (dot_dir);
                if (!exists)