mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-14 01:12:11 -05:00
Release 2023.06
This commit is contained in:
1 parent
a7108f0a09
commit
77bf792b1a
1390 files changed
+66974
-11511
No files matched your search
@@ -70,7 +70,8 @@ RiaVariableMapper::RiaVariableMapper( const QString& variableNameValueTable )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaVariableMapper::addPathAndGetId( const QString& path )
|
||||
{
|
||||
auto computePathId = [this]( const auto& trimmedPath ) -> QString {
|
||||
auto computePathId = [this]( const auto& trimmedPath ) -> QString
|
||||
{
|
||||
QString pathId;
|
||||
auto pathToIdIt = m_valueToVariableMap.find( trimmedPath );
|
||||
if ( pathToIdIt != m_valueToVariableMap.end() )
|
||||
@@ -117,15 +118,18 @@ QString RiaVariableMapper::variableTableAsText() const
|
||||
const QString pathText = variableToken() + pathIdBaseString();
|
||||
|
||||
// Put path variables at the end of the list
|
||||
std::sort( sortedVariables.begin(), sortedVariables.end(), [pathText]( const auto& lhs, const auto& rhs ) {
|
||||
bool isLhsPath = lhs.first.startsWith( pathText );
|
||||
bool isRhsPath = rhs.first.startsWith( pathText );
|
||||
std::sort( sortedVariables.begin(),
|
||||
sortedVariables.end(),
|
||||
[pathText]( const auto& lhs, const auto& rhs )
|
||||
{
|
||||
bool isLhsPath = lhs.first.startsWith( pathText );
|
||||
bool isRhsPath = rhs.first.startsWith( pathText );
|
||||
|
||||
if ( isLhsPath && !isRhsPath ) return false;
|
||||
if ( !isLhsPath && isRhsPath ) return true;
|
||||
if ( isLhsPath && !isRhsPath ) return false;
|
||||
if ( !isLhsPath && isRhsPath ) return true;
|
||||
|
||||
return lhs.first < rhs.first;
|
||||
} );
|
||||
return lhs.first < rhs.first;
|
||||
} );
|
||||
|
||||
QString textTable;
|
||||
textTable += "\n";
|
||||
|
||||
Reference in new issue
Block a user