summaryrefslogtreecommitdiff
path: root/src/lib/config.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-12-16 12:02:51 +0000
committerCarl Hetherington <cth@carlh.net>2016-12-16 12:02:51 +0000
commit396c26415da57f42271ddcf56c1169a437d5a981 (patch)
tree9926029ed802f296d5104c17aa507bace3bb5e28 /src/lib/config.h
parentd0d4cc8626eebd75a75f5b98cf8396786e8456c0 (diff)
Use boost::optional for Config::_default_directory.
Diffstat (limited to 'src/lib/config.h')
-rw-r--r--src/lib/config.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/config.h b/src/lib/config.h
index a38fb129c..c50846707 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -52,7 +52,7 @@ public:
return _num_local_encoding_threads;
}
- boost::filesystem::path default_directory () const {
+ boost::optional<boost::filesystem::path> default_directory () const {
return _default_directory;
}
@@ -290,7 +290,11 @@ public:
}
void set_default_directory (boost::filesystem::path d) {
- maybe_set (_default_directory, d);
+ if (_default_directory && *_default_directory == d) {
+ return;
+ }
+ _default_directory = d;
+ changed ();
}
/** @param p New server port */
@@ -558,7 +562,7 @@ private:
/** number of threads to use for J2K encoding on the local machine */
int _num_local_encoding_threads;
/** default directory to put new films in */
- boost::filesystem::path _default_directory;
+ boost::optional<boost::filesystem::path> _default_directory;
/** base port number to use for J2K encoding servers;
* this port and the two above it will be used.
*/