X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=qui%2Fmotif_editor%2FMotifEditor.cpp;h=acde2d3af74c8a756bb9e05f4855748215f69138;hp=f98402689b3e763c41216b02fe008624109f8268;hb=f88eea68b95773eb5683dcca6cf3fa59b9f00036;hpb=b9dfb1bff573d064acf8cc9ee41f796a1efcaee1 diff --git a/qui/motif_editor/MotifEditor.cpp b/qui/motif_editor/MotifEditor.cpp index f984026..acde2d3 100644 --- a/qui/motif_editor/MotifEditor.cpp +++ b/qui/motif_editor/MotifEditor.cpp @@ -48,14 +48,19 @@ void MotifEditor::setupWidgets() void MotifEditor::updateModel() { - MotifModel *new_model = new MotifModel(analysis); - - // if there was an old model, delete it - if (model) { + // if our current analysis doesn't match the one in our + // model, we probalby changed the analysis. + // so delete and restart + // DET 2007mar30 (can this if statement ever be true? it doesn't look + // like there's a way to change the analysis?) + if (model and model->getAnalysis() != analysis) { delete model; } - // update the QTableView - model = new_model; + + // if we don't have a model, create a new one + if (not model) { + model = new MotifModel(analysis); + } table->setModel(model); updateView(); }