mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use semicolon as string list separator. Fixed bug in tree view state parameter passing.
p4#: 21350
This commit is contained in:
@@ -1246,17 +1246,15 @@ void storeExpandedState(QStringList & nodes, QTreeView * view, QAbstractItemMode
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimUiTreeView::applyTreeViewState(const QString& treeViewState)
|
||||
void RimUiTreeView::applyTreeViewStateFromString(const QString& treeViewState)
|
||||
{
|
||||
if (this->model())
|
||||
{
|
||||
this->collapseAll();
|
||||
|
||||
QString stateString = RiaApplication::instance()->project()->treeViewState;
|
||||
QStringList nodes = treeViewState.split(";");
|
||||
|
||||
QStringList nodes = stateString.split("|");
|
||||
QString path;
|
||||
|
||||
setExpandedState(nodes, this, this->model(), QModelIndex(), path);
|
||||
}
|
||||
}
|
||||
@@ -1264,7 +1262,7 @@ void RimUiTreeView::applyTreeViewState(const QString& treeViewState)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimUiTreeView::storeTreeViewState(QString& treeViewState)
|
||||
void RimUiTreeView::storeTreeViewStateToString(QString& treeViewState)
|
||||
{
|
||||
if (this->model())
|
||||
{
|
||||
@@ -1273,8 +1271,7 @@ void RimUiTreeView::storeTreeViewState(QString& treeViewState)
|
||||
|
||||
storeExpandedState(nodes, this, this->model(), QModelIndex(), path);
|
||||
|
||||
QString stateString = nodes.join("|");
|
||||
RiaApplication::instance()->project()->treeViewState = stateString;
|
||||
treeViewState = nodes.join(";");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user