diff options
author | David Robillard <d@drobilla.net> | 2006-09-11 11:10:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-09-11 11:10:35 +0000 |
commit | b15864870d34a1188eda93ad215734275037278e (patch) | |
tree | 224a1669a29091ea4198425d4a002e448cde8b30 /src/progs/ingenuity/LoadSubpatchWindow.cpp | |
parent | 22bf43352ddfc48452d776f10ad4d12161255049 (diff) | |
download | ingen-b15864870d34a1188eda93ad215734275037278e.tar.gz ingen-b15864870d34a1188eda93ad215734275037278e.tar.bz2 ingen-b15864870d34a1188eda93ad215734275037278e.zip |
Switched homebrew CountedPtr to boost::shared_ptr.
Factories for patch windows, controller.
Robustness updated in many places.
Tons of cleanups, rewrites, bugfixes, etc.
git-svn-id: http://svn.drobilla.net/lad/ingen@128 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/LoadSubpatchWindow.cpp')
-rw-r--r-- | src/progs/ingenuity/LoadSubpatchWindow.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/progs/ingenuity/LoadSubpatchWindow.cpp b/src/progs/ingenuity/LoadSubpatchWindow.cpp index 832c917f..486c92b4 100644 --- a/src/progs/ingenuity/LoadSubpatchWindow.cpp +++ b/src/progs/ingenuity/LoadSubpatchWindow.cpp @@ -33,7 +33,6 @@ namespace Ingenuity { LoadSubpatchWindow::LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) : Gtk::FileChooserDialog(cobject), - m_patch_controller(NULL), m_new_module_x(0), m_new_module_y(0) { @@ -74,7 +73,7 @@ LoadSubpatchWindow::LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefP * This function MUST be called before using the window in any way! */ void -LoadSubpatchWindow::patch_controller(PatchController* pc) +LoadSubpatchWindow::set_patch(CountedPtr<PatchController> pc) { m_patch_controller = pc; @@ -130,7 +129,7 @@ LoadSubpatchWindow::enable_poly_spinner() void LoadSubpatchWindow::ok_clicked() { - assert(m_patch_controller != NULL); + assert(m_patch_controller); assert(m_patch_controller->model()); const string filename = get_filename(); @@ -148,13 +147,13 @@ LoadSubpatchWindow::ok_clicked() poly = m_patch_controller->patch_model()->poly(); if (m_new_module_x == 0 && m_new_module_y == 0) { - m_patch_controller->view()->canvas()->get_new_module_location( + m_patch_controller->get_view()->canvas()->get_new_module_location( m_new_module_x, m_new_module_y); } - PatchModel* pm = new PatchModel(m_patch_controller->model()->base_path() + name, poly); + CountedPtr<PatchModel> pm(new PatchModel(m_patch_controller->model()->path().base() + name, poly)); pm->filename(filename); - pm->set_parent(m_patch_controller->model().get()); + pm->set_parent(m_patch_controller->model()); pm->x(m_new_module_x); pm->y(m_new_module_y); //if (name == "") |