Mercurial > geeqie
diff src/ui_fileops.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 | 1646720364cf |
children | 95860439070b |
line wrap: on
line diff
--- a/src/ui_fileops.c Sat Nov 15 10:35:43 2008 +0000 +++ b/src/ui_fileops.c Sat Nov 15 17:30:45 2008 +0000 @@ -186,6 +186,39 @@ return home; } +const gchar *get_rc_dir(void) +{ + static gchar *rc_dir = NULL; + + if (rc_dir) return rc_dir; + + rc_dir = g_build_filename(homedir(), GQ_RC_DIR, NULL); + + return rc_dir; +} + +const gchar *get_collections_dir(void) +{ + static gchar *collections_dir = NULL; + + if (collections_dir) return collections_dir; + + collections_dir = g_build_filename(get_rc_dir(), GQ_COLLECTIONS_DIR, NULL); + + return collections_dir; +} + +const gchar *get_trash_dir(void) +{ + static gchar *trash_dir = NULL; + + if (trash_dir) return trash_dir; + + trash_dir = g_build_filename(get_rc_dir(), GQ_TRASH_DIR, NULL); + + return trash_dir; +} + gint stat_utf8(const gchar *s, struct stat *st) { gchar *sl;