summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-11 01:36:05 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-11 19:39:04 +0100
commitb75b2a81c24716e21442178b77ee0276ddff843c (patch)
tree3e090cb6b27eba4afc113fc211c6efdb0cfbcc1b /src/lib
parenta983627b357e25478a524a20cafa4a68a4b9299f (diff)
Show a splash screen if config needs creating.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc10
-rw-r--r--src/lib/config.h3
2 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index f71fff86c..cc62bfed3 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -119,7 +119,7 @@ Config::restore_defaults ()
void
Config::read ()
{
- if (!boost::filesystem::exists (file ())) {
+ if (!have_existing ()) {
/* Make a new set of signing certificates and key */
_signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
/* And similar for decryption of KDMs */
@@ -263,7 +263,7 @@ Config::read ()
/** @return Filename to write configuration to */
boost::filesystem::path
-Config::file () const
+Config::file ()
{
boost::filesystem::path p;
#ifdef DCPOMATIC_OSX
@@ -456,3 +456,9 @@ Config::add_to_history (boost::filesystem::path p)
changed ();
}
+
+bool
+Config::have_existing ()
+{
+ return boost::filesystem::exists (file ());
+}
diff --git a/src/lib/config.h b/src/lib/config.h
index eeb167d0d..70971085a 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -417,10 +417,11 @@ public:
static Config* instance ();
static void drop ();
static void restore_defaults ();
+ static bool have_existing ();
private:
Config ();
- boost::filesystem::path file () const;
+ static boost::filesystem::path file ();
void read ();
void set_defaults ();
void set_kdm_email_to_default ();