From f3d42738f667dd09a4da9cc0a863c44e9cdb3666 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 1 May 2014 12:33:34 +1200 Subject: Debug messages --- trayfreq.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'trayfreq.c') diff --git a/trayfreq.c b/trayfreq.c index e7c8933..e3b925e 100644 --- a/trayfreq.c +++ b/trayfreq.c @@ -24,6 +24,7 @@ #include "freq_tray/getgov.h" #include "config_file.h" #include "defaults.h" +#include "debug.h" #include #include @@ -43,14 +44,17 @@ void config_init() config.file_name = g_strconcat(getenv("HOME"), "/.trayfreq.config", NULL); + // Check if ~/.trayfreq.config exists if( (fd = fopen(config.file_name, "r")) ) { // If file exists, close it, set param to TRUE + debug("Found '%s'\n",config.file_name); fclose(fd); home_config_exists = TRUE; } else { // If file didn't exist, it's not open (don't close it), free filename var, set param to FALSE + debug("Didn't find '%s'\n",config.file_name); g_free(config.file_name); home_config_exists = FALSE; } @@ -62,6 +66,7 @@ void config_init() if(!success) { + debug("Couldn't open '%s' for reading\n",config.file_name); g_warning(_("Failed to open config files!\n")); return; } @@ -100,10 +105,12 @@ int main(int argc, char** argv) setlocale(LC_ALL, ""); bindtextdomain("trayfreq","/usr/share/locale"); textdomain("trayfreq"); + debug("Set gettext up\n"); if(!gtk_init_check(&argc, &argv)) { - g_error(_("GTK Error: gtk_init_check returned FALSE.\nBailing.") ); + debug("Couldn't start gtk\n"); + g_error( _("GTK Error: gtk_init_check returned FALSE.\nBailing.") ); return 1; } config_init(); @@ -116,10 +123,13 @@ int main(int argc, char** argv) // Show battery tray only if we're supposed to if(SHOW_BATTERY) { + debug("Showing battery info this time around\n"); bat_tray_init(); bat_tray_show(); } + debug("Passing control to Gtk\n"); gtk_main(); + debug("Exiting main()\n"); return 0; } -- cgit v1.1