Skip to content
Snippets Groups Projects
Commit 0c602cfa authored by Karsten Rink's avatar Karsten Rink Committed by Tom Fischer
Browse files

[A/DE] Reuse already fetched model variable.

parent f419a7b8
No related branches found
No related tags found
No related merge requests found
...@@ -165,8 +165,7 @@ void MshView::openMeshEditDialog() ...@@ -165,8 +165,7 @@ void MshView::openMeshEditDialog()
{ {
MshModel const*const model = static_cast<MshModel*>(this->model()); MshModel const*const model = static_cast<MshModel*>(this->model());
QModelIndex const index = this->selectionModel()->currentIndex(); QModelIndex const index = this->selectionModel()->currentIndex();
const MeshLib::Mesh* mesh = MeshLib::Mesh const*const mesh = model->getMesh(index);
static_cast<MshModel*>(this->model())->getMesh(index);
MeshLayerEditDialog meshLayerEdit(mesh); MeshLayerEditDialog meshLayerEdit(mesh);
connect(&meshLayerEdit, SIGNAL(mshEditFinished(MeshLib::Mesh*)), connect(&meshLayerEdit, SIGNAL(mshEditFinished(MeshLib::Mesh*)),
...@@ -178,7 +177,7 @@ void MshView::openValuesEditDialog() ...@@ -178,7 +177,7 @@ void MshView::openValuesEditDialog()
{ {
MshModel const*const model = static_cast<MshModel*>(this->model()); MshModel const*const model = static_cast<MshModel*>(this->model());
QModelIndex const index = this->selectionModel()->currentIndex(); QModelIndex const index = this->selectionModel()->currentIndex();
MeshLib::Mesh* mesh = const_cast<MeshLib::Mesh*>(static_cast<MshModel*>(this->model())->getMesh(index)); MeshLib::Mesh* mesh = const_cast<MeshLib::Mesh*>(model->getMesh(index));
MeshValueEditDialog valueEdit(mesh); MeshValueEditDialog valueEdit(mesh);
connect(&valueEdit, SIGNAL(valueEditFinished(MeshLib::Mesh*)), connect(&valueEdit, SIGNAL(valueEditFinished(MeshLib::Mesh*)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment