mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#655) Sort the wells in the Wells folder by name
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user