From f01a21b103f655652aa58dcbd2ffbae1413e01df Mon Sep 17 00:00:00 2001 From: David Date: Thu, 13 Feb 2014 19:32:49 +1300 Subject: Updated readme --- src/trayfreq.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'src/trayfreq.c') diff --git a/src/trayfreq.c b/src/trayfreq.c index 4db2444..2b65af5 100644 --- a/src/trayfreq.c +++ b/src/trayfreq.c @@ -34,27 +34,25 @@ static gboolean SHOW_BATTERY = TRUE; void config_init() { - struct config_file config; - gboolean home_config_exists = TRUE; - config.key_file = NULL; - - gchar* home = getenv("HOME"); - config.file_name = g_strconcat(home, "/.trayfreq.config", NULL); - FILE* fd = fopen(config.file_name, "r"); - if(!fd) - { - g_free(config.file_name); - home_config_exists = FALSE; - } - else - { - fclose(fd); + struct config_file config; + gboolean home_config_exists = TRUE; + config.key_file = NULL; + + gchar* home = getenv("HOME"); + config.file_name = g_strconcat(home, "/.trayfreq.config", NULL); + FILE* fd = fopen(config.file_name, "r"); + if(!fd) + { + g_free(config.file_name); + home_config_exists = FALSE; + } else { + fclose(fd); } - if(!home_config_exists) - config.file_name = g_strconcat(util_get_prefix(), "/share/trayfreq/trayfreq.config", NULL); + if(!home_config_exists) + config.file_name = g_strconcat(util_get_prefix(), "/share/trayfreq/trayfreq.config", NULL); - gboolean success = config_open(&config); + gboolean success = config_open(&config); if(!success) { -- cgit v1.1