# HG changeset patch # User gyorgyf # Date 1365863814 -3600 # Node ID 7256926d3af1d54d92e259640661c69adfca603a # Parent 1336439dc05523f28073bbe2e443a1cebef3bbaf cleanup diff -r 1336439dc055 -r 7256926d3af1 layer/FlexiNoteLayer.cpp --- a/layer/FlexiNoteLayer.cpp Sat Apr 13 13:39:17 2013 +0100 +++ b/layer/FlexiNoteLayer.cpp Sat Apr 13 15:36:54 2013 +0100 @@ -63,9 +63,8 @@ } void -FlexiNoteLayer::setModel(FlexiNoteModel *model) // THIS FUNCTION FAILS +FlexiNoteLayer::setModel(FlexiNoteModel *model) { - std::cerr << "NOTE: FlexiNoteLayer::setModel called" << std::endl; //delete this!! if (m_model == model) return; m_model = model; @@ -75,7 +74,6 @@ m_scaleMinimum = 0; m_scaleMaximum = 0; - std::cerr << "NOTE: FlexiNoteLayer::NoteModel set" << std::endl; //delete this!! emit modelReplaced(); } diff -r 1336439dc055 -r 7256926d3af1 layer/LayerFactory.cpp --- a/layer/LayerFactory.cpp Sat Apr 13 13:39:17 2013 +0100 +++ b/layer/LayerFactory.cpp Sat Apr 13 15:36:54 2013 +0100 @@ -161,13 +161,12 @@ } if (dynamic_cast(model)) { - // types.insert(FlexiNotes); types.insert(Notes); } + // NOTE: GF: types is a set, so order of insertion does not matter if (dynamic_cast(model)) { types.insert(FlexiNotes); - // types.insert(Notes); } if (dynamic_cast(model)) { @@ -296,8 +295,6 @@ // if (trySetModel(layer, model)) // return; - std::cerr << "LayerFactory::setModel called... " << std::endl; - if (trySetModel(layer, model)) return; @@ -316,20 +313,13 @@ if (trySetModel(layer, model)) return; - if (trySetModel(layer, model)) { - std::cerr << "trying to set note layer model" << std::endl; - return; } + if (trySetModel(layer, model)) + return; - if (trySetModel(layer, model)) { - std::cerr << "trying to set flexi note layer model" << std::endl; - return; } + // GF: added FlexiNoteLayer + if (trySetModel(layer, model)) + return; - FlexiNoteLayer *clayer = dynamic_cast(layer); - if (!clayer) { std::cerr << "layer cast failed" << std::endl; return; } - FlexiNoteModel *cmodel = dynamic_cast(model); - if (!cmodel) { std::cerr << "model cast failed" << std::endl; return; } - clayer->setModel(cmodel); - if (trySetModel(layer, model)) return; @@ -350,7 +340,6 @@ // if (trySetModel(layer, model)) // return; - std::cerr << "LayerFactory::setModel done... " << std::endl; } Model * diff -r 1336439dc055 -r 7256926d3af1 layer/NoteLayer.cpp --- a/layer/NoteLayer.cpp Sat Apr 13 13:39:17 2013 +0100 +++ b/layer/NoteLayer.cpp Sat Apr 13 15:36:54 2013 +0100 @@ -54,9 +54,7 @@ void NoteLayer::setModel(NoteModel *model) -{ - std::cerr << "NOTE: called NoteLayer::setModel" << std::endl; //delete this!! - +{ if (m_model == model) return; m_model = model; @@ -67,8 +65,6 @@ m_scaleMinimum = 0; m_scaleMaximum = 0; - std::cerr << "NOTE: NoteLayer::NoteModel set" << std::endl; //delete this!! - emit modelReplaced(); }