summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-26 23:39:01 +0000
committerDavid Robillard <d@drobilla.net>2007-07-26 23:39:01 +0000
commitf36e709b68144191d51959d6a2224cd9c3ad7871 (patch)
tree19f6f9ad4dd573d90224c56052c7bacfc1f76f08 /src/libs/gui
parent23d74f838521320dc1682426341d1874061337a6 (diff)
downloadingen-f36e709b68144191d51959d6a2224cd9c3ad7871.tar.gz
ingen-f36e709b68144191d51959d6a2224cd9c3ad7871.tar.bz2
ingen-f36e709b68144191d51959d6a2224cd9c3ad7871.zip
Fix recursive patch serialization (fix ticket 63).
git-svn-id: http://svn.drobilla.net/lad/ingen@642 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/PatchWindow.cpp4
-rw-r--r--src/libs/gui/ThreadedLoader.cpp13
-rw-r--r--src/libs/gui/ThreadedLoader.hpp4
3 files changed, 8 insertions, 13 deletions
diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp
index b0b87c5e..e92f0fd7 100644
--- a/src/libs/gui/PatchWindow.cpp
+++ b/src/libs/gui/PatchWindow.cpp
@@ -306,7 +306,7 @@ PatchWindow::event_save()
if (_patch->filename() == "")
event_save_as();
else
- App::instance().loader()->save_patch(_patch, _patch->filename(), false);
+ App::instance().loader()->save_patch(_patch, _patch->filename());
}
@@ -363,7 +363,7 @@ PatchWindow::event_save_as()
fin.close();
if (confirm) {
- App::instance().loader()->save_patch(_patch, filename, true);
+ App::instance().loader()->save_patch(_patch, filename);
_patch->set_filename(filename);
//_patch->set_metadata("filename", Atom(filename.c_str()));
}
diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp
index 63c5bf3c..ecabe5e1 100644
--- a/src/libs/gui/ThreadedLoader.cpp
+++ b/src/libs/gui/ThreadedLoader.cpp
@@ -113,13 +113,13 @@ ThreadedLoader::load_patch(bool merge,
void
-ThreadedLoader::save_patch(SharedPtr<PatchModel> model, const string& filename, bool recursive)
+ThreadedLoader::save_patch(SharedPtr<PatchModel> model, const string& filename)
{
_mutex.lock();
_events.push_back(sigc::hide_return(sigc::bind(
sigc::mem_fun(this, &ThreadedLoader::save_patch_event),
- model, filename, recursive)));
+ model, filename)));
_mutex.unlock();
@@ -128,14 +128,9 @@ ThreadedLoader::save_patch(SharedPtr<PatchModel> model, const string& filename,
void
-ThreadedLoader::save_patch_event(SharedPtr<PatchModel> model, const string& filename, bool recursive)
+ThreadedLoader::save_patch_event(SharedPtr<PatchModel> model, const string& filename)
{
- if (recursive)
- cerr << "FIXME: Recursive save." << endl;
-
- _serializer.start_to_filename(filename);
- _serializer.serialize(model);
- _serializer.finish();
+ _serializer.to_file(model, filename);
}
diff --git a/src/libs/gui/ThreadedLoader.hpp b/src/libs/gui/ThreadedLoader.hpp
index e8574f6f..a08ee158 100644
--- a/src/libs/gui/ThreadedLoader.hpp
+++ b/src/libs/gui/ThreadedLoader.hpp
@@ -69,11 +69,11 @@ public:
optional<const string&> engine_name = optional<const string&>(),
optional<size_t> engine_poly = optional<size_t>());
- void save_patch(SharedPtr<PatchModel> model, const string& filename, bool recursive);
+ void save_patch(SharedPtr<PatchModel> model, const string& filename);
private:
- void save_patch_event(SharedPtr<PatchModel> model, const string& filename, bool recursive);
+ void save_patch_event(SharedPtr<PatchModel> model, const string& filename);
/** Returns nothing and takes no parameters (because they have all been bound) */
typedef sigc::slot<void> Closure;