mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Fixed UITreeView::selectRowWithPath.
This commit is contained in:
@@ -683,14 +683,15 @@ ModelIndex UITreeView::selectRowWithPath( std::string path ) {
|
||||
ModelIndex foundIndex = {};
|
||||
const auto& part = pathPart[i];
|
||||
|
||||
traverseTree( [&]( const int&, const ModelIndex& index, const size_t&, const Float& ) {
|
||||
Variant var = model->data( index );
|
||||
if ( var.isValid() && var.toString() == part ) {
|
||||
foundIndex = index;
|
||||
return IterationDecision::Stop;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
} );
|
||||
traverseTree(
|
||||
[&, i]( const int&, const ModelIndex& index, const size_t& indentLevel, const Float& ) {
|
||||
Variant var = model->data( index );
|
||||
if ( i == indentLevel && var.isValid() && var.toString() == part ) {
|
||||
foundIndex = index;
|
||||
return IterationDecision::Stop;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
} );
|
||||
|
||||
if ( foundIndex == ModelIndex() )
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user