diff src/options.c @ 1145:3a7af6a8cd5f

Use functions to return directories instead of constants. Following functions were added: get_collections_dir() get_metadata_cache_dir() get_rc_dir() get_thumbnails_cache_dir() get_trash_dir() They return the full directory path.
author zas_
date Sat, 15 Nov 2008 17:30:45 +0000
parents 1e2de04c6fc4
children c45cc5cf3c4d
line wrap: on
line diff
--- a/src/options.c	Sat Nov 15 10:35:43 2008 +0000
+++ b/src/options.c	Sat Nov 15 17:30:45 2008 +0000
@@ -183,12 +183,10 @@
 	path = g_build_filename(homedir(), "Desktop", NULL);
 	bookmark_add_default(_("Desktop"), path);
 	g_free(path);
-	path = g_build_filename(homedir(), GQ_RC_DIR_COLLECTIONS, NULL);
-	bookmark_add_default(_("Collections"), path);
-	g_free(path);
+	bookmark_add_default(_("Collections"), get_collections_dir());
 
 	g_free(options->file_ops.safe_delete_path);
-	options->file_ops.safe_delete_path = g_build_filename(homedir(), GQ_RC_DIR_TRASH, NULL);
+	options->file_ops.safe_delete_path = g_strdup(get_trash_dir());
 
 	for (i = 0; i < COLOR_PROFILE_INPUTS; i++)
 		{
@@ -260,7 +258,7 @@
 
 	sync_options_with_current_state(options);
 
-	rc_path = g_build_filename(homedir(), GQ_RC_DIR, RC_FILE_NAME, NULL);
+	rc_path = g_build_filename(get_rc_dir(), RC_FILE_NAME, NULL);
 	save_options_to(rc_path, options);
 	g_free(rc_path);
 }
@@ -278,7 +276,7 @@
 		g_free(rc_path);
 		}
 	
-	rc_path = g_build_filename(homedir(), GQ_RC_DIR, RC_FILE_NAME, NULL);
+	rc_path = g_build_filename(get_rc_dir(), RC_FILE_NAME, NULL);
 	success = load_options_from(rc_path, options);
 	DEBUG_1("Loading options from %s ... %s", rc_path, success ? "done" : "failed");
 	g_free(rc_path);