From b840c918e0a355eabcfff49efc2f4c61803b5c52 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 20:51:43 -0500 Subject: Building a file name and checking if it exists. --- src/seen-db.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/seen-db.c b/src/seen-db.c index cf2293c..027100d 100644 --- a/src/seen-db.c +++ b/src/seen-db.c @@ -1,6 +1,7 @@ #include "seen-db.h" GHashTable * seendb = NULL; +gchar * filename = NULL; void seen_db_init(void) @@ -10,6 +11,18 @@ seen_db_init(void) } seendb = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + + /* Build the filename for the seen database. We're putting + it in the cache directory because it could get deleted and + it really wouldn't be a big deal. */ + if (filename == NULL) { + filename = g_build_filename(g_get_user_cache_dir(), "indicators", "messages", "seen-db.keyfile", NULL); + } + + if (g_file_test(filename, G_FILE_TEST_EXISTS)) { + + } + return; } -- cgit v1.2.3