changeset 2205:1177b33d4550

Do not hardcode the default logging location The current configuration directory is used as a base.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 17 Oct 2015 20:19:58 +0200
parents ccd4ffa41a1b
children 5d0b2fe13939
files mcabber/mcabber/histolog.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/histolog.c	Sat Oct 17 20:17:30 2015 +0200
+++ b/mcabber/mcabber/histolog.c	Sat Oct 17 20:19:58 2015 +0200
@@ -358,7 +358,8 @@
 }
 
 //  hlog_enable()
-// Enable logging to files.  If root_dir is NULL, then $HOME/.mcabber is used.
+// Enable logging to files.  If root_dir is NULL, then the subdirectory "histo"
+// in mcabber configuration directory is used.
 // If loadfiles is TRUE, we will try to load buddies history logs from file.
 void hlog_enable(guint enable, const char *root_dir, guint loadfiles)
 {
@@ -383,9 +384,9 @@
         g_free(xp_root_dir);
       }
     } else {
-      char *home = getenv("HOME");
-      const char *dir = "/.mcabber/histo/";
-      RootDir = g_strdup_printf("%s%s", home, dir);
+      const char *cfgdir = settings_get_mcabber_config_dir();
+      const char *hdir = "/histo/";
+      RootDir = g_strdup_printf("%s%s", cfgdir, hdir);
     }
     // Check directory permissions (should not be readable by group/others)
     if (checkset_perm(RootDir, TRUE) == -1) {