diff options
author | Marcus Müller <marcus.mueller@ettus.com> | 2016-05-07 17:14:49 +0200 |
---|---|---|
committer | Marcus Müller <marcus.mueller@ettus.com> | 2016-05-07 17:14:49 +0200 |
commit | 438fb307a0b593706a212a3cd6e16f217a8704d0 (patch) | |
tree | 2d8c41697fec83e9ea3274ecf1133be7bec8a225 /gnuradio-runtime/lib/prefs.cc | |
parent | 6aa995a5477feea1b6f9ef1f49c3045c25d147b1 (diff) |
added user settings directory as a gr::-accessible path
* removing a bit of "magic paths" in prefs.cc
* added constant
Diffstat (limited to 'gnuradio-runtime/lib/prefs.cc')
-rw-r--r-- | gnuradio-runtime/lib/prefs.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gnuradio-runtime/lib/prefs.cc b/gnuradio-runtime/lib/prefs.cc index b303ffdaf9..7fd38ef6d7 100644 --- a/gnuradio-runtime/lib/prefs.cc +++ b/gnuradio-runtime/lib/prefs.cc @@ -77,10 +77,9 @@ namespace gr { // Find if there is a ~/.gnuradio/config.conf file and add this to // the end of the file list to override any preferences in the // installed path config files. - fs::path homedir = fs::path(gr::appdata_path()); - homedir = homedir/".gnuradio/config.conf"; - if(fs::exists(homedir)) { - fnames.push_back(homedir.string()); + fs::path userconf = fs::path(gr::userconf_path()) / "config.conf"; + if(fs::exists(userconf)) { + fnames.push_back(userconf.string()); } return fnames; @@ -222,10 +221,8 @@ namespace gr { prefs::save() { std::string conf = to_string(); - - fs::path homedir = fs::path(gr::appdata_path()); - homedir = homedir/".gnuradio/config.conf"; - fs::ofstream fout(homedir); + fs::path userconf = fs::path(gr::userconf_path()) / "config.conf"; + fs::ofstream fout(userconf); fout << conf; fout.close(); } |