Save config in the right place cross-platform.
authorCarl Hetherington <cth@carlh.net>
Tue, 24 Jul 2012 20:04:07 +0000 (21:04 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 24 Jul 2012 20:04:07 +0000 (21:04 +0100)
src/lib/config.cc
src/lib/wscript

index 6d31ccd9e6da183f5a964e9039a201f4c5ac7aa5..92044d81a57764b9072691ca00a6ef9e54739296 100644 (file)
@@ -20,6 +20,8 @@
 #include <sstream>
 #include <cstdlib>
 #include <fstream>
+#include <glib.h>
+#include <boost/filesystem.hpp>
 #include "config.h"
 #include "server.h"
 #include "scaler.h"
@@ -93,9 +95,10 @@ Config::Config ()
 string
 Config::file () const
 {
-       stringstream s;
-       s << getenv ("HOME") << "/.dvdomatic";
-       return s.str ();
+       filesystem::path p;
+       p /= g_get_user_config_dir ();
+       p /= ".dvdomatic";
+       return p.string ();
 }
 
 /** @return Singleton instance */
index 75f7eddeda2e779d33554d026aae70b6c7c7a81f..afc91660560e289c32e7a297ad4ee287bd4493ae 100644 (file)
@@ -7,7 +7,7 @@ def build(bld):
     obj = bld(features = 'cxx cxxshlib')
     obj.name = 'libdvdomatic'
     obj.export_includes = ['.']
-    obj.uselib = 'AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE SNDFILE BOOST_FILESYSTEM BOOST_THREAD OPENJPEG POSTPROC TIFF SIGC++ MAGICK SSH DCP'
+    obj.uselib = 'AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE SNDFILE BOOST_FILESYSTEM BOOST_THREAD OPENJPEG POSTPROC TIFF SIGC++ MAGICK SSH DCP GLIB'
     if bld.env.TARGET_WINDOWS:
         obj.uselib += ' WINSOCK2'
     if bld.env.DEBUG_HASH: