← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~qense/notify-osd/fix-465801 into lp:notify-osd

 

Sense Hofstede has proposed merging lp:~qense/notify-osd/fix-465801 into lp:notify-osd.

    Requested reviews:
    Notify OSD Developers (notify-osd-developers)
Related bugs:
  #465801 notify-osd.log file stored in .cache, not in user-set XDG cache folder
  https://bugs.launchpad.net/bugs/465801


These changes fix bug #465801 and have been tested and found to be working.
The variable dirname in src/log.c is now a const gchar* and is not freed. Instead of hardcoding the use of ~/.cache, now the function g_get_user_cache_dir() is used. Therefore <glib.h> is included in src/log.c
-- 
https://code.launchpad.net/~qense/notify-osd/fix-465801/+merge/14265
Your team ayatana-commits is subscribed to branch lp:notify-osd.
=== modified file 'src/log.c'
--- src/log.c	2009-04-09 07:33:35 +0000
+++ src/log.c	2009-10-31 19:10:23 +0000
@@ -30,6 +30,7 @@
 #include <sys/time.h>
 #include <time.h>
 #include <stdio.h>
+#include <glib.h>
 
 #include "bubble.h"
 
@@ -53,11 +54,11 @@
 	g_return_if_fail (homedir != NULL);
 
 	// Make sure the cache directory is there, if at all possible
-	char *dirname = g_strdup_printf ("%s/.cache", homedir);
+	const gchar *dirname = g_get_user_cache_dir ();
 	g_mkdir_with_parents (dirname, 0700);
 
 	char *filename = 
-		g_strdup_printf ("%s/.cache/notify-osd.log", homedir);
+		g_strdup_printf ("%s/notify-osd.log", dirname);
 
 	logfile = fopen (filename, "w");
 	if (logfile == NULL)
@@ -65,7 +66,6 @@
 			   filename);
 
 	g_free (filename);
-	g_free (dirname);
 
 	/* discard all debug messages unless DEBUG is set */
 	if (! g_getenv ("DEBUG"))


Follow ups