summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-02-19 10:48:37 -0500
committerTom Rondeau <trondeau@vt.edu>2013-02-19 10:48:37 -0500
commitd57af91afd6c432d9cc174a85dda7ee6869a766c (patch)
tree9cac0eeb1eec422ae89eff1240eefac3d09ab23c
parenta8455fd176a6e712604795b62f8934c9d911159a (diff)
core: prefs setup looks for a local .gnuradio/config.conf to use.
Order of precedence: env. vars -> .gnuradio/config.conf -> ${prefix}/etc/gnuradio/conf.d/*
-rw-r--r--gnuradio-core/src/lib/general/gr_prefs.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/general/gr_prefs.cc b/gnuradio-core/src/lib/general/gr_prefs.cc
index 34303a5629..68354c6db9 100644
--- a/gnuradio-core/src/lib/general/gr_prefs.cc
+++ b/gnuradio-core/src/lib/general/gr_prefs.cc
@@ -25,6 +25,7 @@
#endif
#include <gr_prefs.h>
+#include <gr_sys_paths.h>
#include <gr_constants.h>
#include <algorithm>
@@ -77,6 +78,17 @@ gr_prefs::_sys_prefs_filenames()
fnames.push_back(p.string());
}
std::sort(fnames.begin(), fnames.end());
+
+ // Find if there is a ~/.gnuradio/config file and add this to the
+ // beginning of the file list to override any preferences in the
+ // installed path config files.
+ fs::path homedir = fs::path(gr_appdata_path());
+ homedir /= ".gnuradio/config.conf";
+ std::cerr << "Checking path:" << homedir << std::endl;
+ if(fs::exists(homedir)) {
+ fnames.insert(fnames.begin(), homedir.string());
+ }
+
return fnames;
}