From 764f9e7c0d0263f6fc0a9f5f4dd0060521d33f26 Mon Sep 17 00:00:00 2001 From: Radim Blazek Date: Thu, 19 Feb 2015 12:50:20 +0100 Subject: [PATCH] Browser favourites restore state fix --- src/gui/qgsbrowsertreeview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/qgsbrowsertreeview.cpp b/src/gui/qgsbrowsertreeview.cpp index 86db5273e56..674b54b694c 100644 --- a/src/gui/qgsbrowsertreeview.cpp +++ b/src/gui/qgsbrowsertreeview.cpp @@ -180,9 +180,13 @@ void QgsBrowserTreeView::rowsInserted( const QModelIndex & parentIndex, int star { QModelIndex childIndex = model()->index( i, 0, parentIndex ); QString childPath = model()->data( childIndex, QgsBrowserModel::PathRole ).toString(); + QString escapedChildPath = childPath; + escapedChildPath.replace( "|", "\\|" ); - if ( mExpandPaths.contains( childPath ) || mExpandPaths.indexOf( QRegExp( "^" + childPath + "/.*" ) ) != -1 ) + QgsDebugMsgLevel( "childPath = " + childPath + " escapedChildPath = " + escapedChildPath, 2 ); + if ( mExpandPaths.contains( childPath ) || mExpandPaths.indexOf( QRegExp( "^" + escapedChildPath + "/.*" ) ) != -1 ) { + QgsDebugMsgLevel( "-> expand", 2 ); expand( childIndex ); } }