Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix build, dox
  • Loading branch information
nyalldawson committed Jun 28, 2020
1 parent 005ac8a commit ac1591a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/core/qgsruntimeprofiler.cpp
Expand Up @@ -92,11 +92,11 @@ int QgsRuntimeProfilerNode::indexOf( QgsRuntimeProfilerNode *child ) const
return -1;
}

QgsRuntimeProfilerNode *QgsRuntimeProfilerNode::child( const QString &group, const QString &path )
QgsRuntimeProfilerNode *QgsRuntimeProfilerNode::child( const QString &group, const QString &name )
{
for ( auto &it : mChildren )
{
if ( it->data( Group ).toString() == group && it->data( Name ).toString() == path )
if ( it->data( Group ).toString() == group && it->data( Name ).toString() == name )
return it.get();
}
return nullptr;
Expand Down Expand Up @@ -507,10 +507,13 @@ void QgsRuntimeProfiler::setupConnections()

QgsRuntimeProfilerNode *QgsRuntimeProfiler::pathToNode( const QString &group, const QString &path ) const
{
QStringList parts = path.split( '/', Qt::SkipEmptyParts );
QStringList parts = path.split( '/' );
QgsRuntimeProfilerNode *res = mRootNode.get();
for ( const QString &part : parts )
{
if ( part.isEmpty() )
continue;

res = res->child( group, part );
if ( !res )
break;
Expand Down
6 changes: 5 additions & 1 deletion src/core/qgsruntimeprofiler.h
Expand Up @@ -90,7 +90,11 @@ class CORE_EXPORT QgsRuntimeProfilerNode
*/
int indexOf( QgsRuntimeProfilerNode *child ) const;

QgsRuntimeProfilerNode *child( const QString &group, const QString &path );
/**
* Finds the child with matching \a group and \a name. Returns NULLPTR if
* a matching child was not found.
*/
QgsRuntimeProfilerNode *child( const QString &group, const QString &name );

/**
* Returns the child at the specified \a index.
Expand Down

0 comments on commit ac1591a

Please sign in to comment.