(#467) Postponing updates until all tracks have been moved to a plot

This commit is contained in:
Pål Hagen 2015-10-19 14:07:06 +02:00
parent b2e04b47d9
commit 36f2229b5b

View File

@ -58,19 +58,28 @@ void RicWellLogPlotTrackFeatureImpl::moveTracksToWellLogPlot(RimWellLogPlot* wel
{ {
CVF_ASSERT(wellLogPlot); CVF_ASSERT(wellLogPlot);
RimWellLogPlotTrack* wellLogPlotTrack = NULL;
for (size_t tIdx = 0; tIdx < tracks.size(); tIdx++) for (size_t tIdx = 0; tIdx < tracks.size(); tIdx++)
{ {
wellLogPlotTrack = tracks[tIdx];
RimWellLogPlot* oldPlot; RimWellLogPlot* oldPlot;
tracks[tIdx]->firstAnchestorOrThisOfType(oldPlot); wellLogPlotTrack->firstAnchestorOrThisOfType(oldPlot);
if (oldPlot) if (oldPlot)
{ {
oldPlot->removeTrack(tracks[tIdx]); oldPlot->removeTrack(wellLogPlotTrack);
oldPlot->updateConnectedEditors(); oldPlot->updateConnectedEditors();
} }
wellLogPlot->addTrack(tracks[tIdx]); wellLogPlot->addTrack(wellLogPlotTrack);
wellLogPlot->updateTracks(); }
wellLogPlot->updateConnectedEditors();
RiuMainWindow::instance()->projectTreeView()->selectAsCurrentItem(tracks[tIdx]); wellLogPlot->updateTracks();
wellLogPlot->updateConnectedEditors();
if (wellLogPlotTrack)
{
RiuMainWindow::instance()->projectTreeView()->selectAsCurrentItem(wellLogPlotTrack);
} }
} }