(#655) Sort the wells in the Wells folder by name

This commit is contained in:
Jacob Støren
2015-11-30 14:32:34 +01:00
parent 707e8c68ab
commit d637248ae9
2 changed files with 22 additions and 1 deletions

View File

@@ -164,6 +164,8 @@ void RimWellPathCollection::readWellPathFiles()
progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name));
progress.incrementProgress();
}
this->sortWellsByName();
}
@@ -258,6 +260,8 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
progress.incrementProgress();
}
this->sortWellsByName();
}
@@ -282,6 +286,8 @@ void RimWellPathCollection::addWellLogs(const QStringList& filePaths)
wellPath->setLogFileInfo(logFileInfo);
}
}
this->sortWellsByName();
}
//--------------------------------------------------------------------------------------------------
@@ -381,6 +387,19 @@ void RimWellPathCollection::removeWellPath(RimWellPath* wellPath)
}
}
bool lessWellPath(const caf::PdmPointer<RimWellPath>& w1, const caf::PdmPointer<RimWellPath>& w2)
{
return (w1->name() < w2->name());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::sortWellsByName()
{
std::sort(wellPaths.begin(), wellPaths.end(), lessWellPath);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------