summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-12-20 20:42:22 +0000
committerDavid Robillard <d@drobilla.net>2008-12-20 20:42:22 +0000
commitc3e910cca37092c1eaf125b585753a1d1e0823af (patch)
treecba14e4b81c1dadfdef94e5c1d7a558196db69db
parent548584572ef2d755391dd3b2e2f901453ddc1016 (diff)
downloadpatchage-c3e910cca37092c1eaf125b585753a1d1e0823af.tar.gz
patchage-c3e910cca37092c1eaf125b585753a1d1e0823af.tar.bz2
patchage-c3e910cca37092c1eaf125b585753a1d1e0823af.zip
Don't attempt to write nonexistant module location settings (fix ticket #252).
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@1878 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/StateManager.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/StateManager.cpp b/src/StateManager.cpp
index 32e3d7d..f5dcc94 100644
--- a/src/StateManager.cpp
+++ b/src/StateManager.cpp
@@ -227,15 +227,20 @@ StateManager::save(const string& filename)
os << "zoom_level " << _zoom << std::endl;
- for (map<string, ModuleSettings>::iterator i = _module_settings.begin(); i != _module_settings.end(); ++i) {
+ for (map<string, ModuleSettings>::iterator i = _module_settings.begin();
+ i != _module_settings.end(); ++i) {
const ModuleSettings& settings = (*i).second;
const string& name = (*i).first;
if (settings.split) {
- write_module_settings_entry(os, name, "input", *settings.input_location);
- write_module_settings_entry(os, name, "output", *settings.output_location);
+ if (settings.input_location && settings.output_location) {
+ write_module_settings_entry(os, name, "input", *settings.input_location);
+ write_module_settings_entry(os, name, "output", *settings.output_location);
+ }
} else {
- write_module_settings_entry(os, name, "inputoutput", *settings.inout_location);
+ if (settings.input_location && settings.inout_location) {
+ write_module_settings_entry(os, name, "inputoutput", *settings.inout_location);
+ }
}
}