summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-05-07 12:53:55 +0100
committerCarl Hetherington <cth@carlh.net>2015-05-07 12:53:55 +0100
commit21fb4ee6deb1321b37ad360cabdc8963774a4897 (patch)
treedc0584b364e452d32a945f07dfe2eddfbd582c4c /src
parent6e3dfa7c6d719ec9044dc6b764ee3e4a50ee3190 (diff)
Only write config on change from the UI, not (say) from tests.
Diffstat (limited to 'src')
-rw-r--r--src/lib/config.cc1
-rw-r--r--src/lib/config.h3
-rw-r--r--src/tools/dcpomatic.cc3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index ab57c1afc..5a0b74854 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -431,7 +431,6 @@ Config::drop ()
void
Config::changed ()
{
- write ();
Changed ();
}
diff --git a/src/lib/config.h b/src/lib/config.h
index 4f47ab314..f436061e8 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -407,6 +407,8 @@ public:
void changed ();
boost::signals2::signal<void ()> Changed;
+ void write () const;
+
static Config* instance ();
static void drop ();
static void restore_defaults ();
@@ -415,7 +417,6 @@ private:
Config ();
boost::filesystem::path file () const;
void read ();
- void write () const;
void make_decryption_keys ();
void set_defaults ();
void set_kdm_email_to_default ();
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index e0c0148b0..e59220785 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -236,6 +236,9 @@ public:
Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file);
wxAcceleratorTable accel_table (1, accel);
SetAcceleratorTable (accel_table);
+
+ /* Instantly save any config changes when using the DCP-o-matic GUI */
+ Config::instance()->Changed.connect (boost::bind (&Config::write, Config::instance ()));
}
void new_film (boost::filesystem::path path)