diff --git a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp index 8781311839..9c189bf6f7 100644 --- a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp +++ b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp @@ -103,10 +103,18 @@ void findItemsMatching( QStandardItem* parentItem, const QString& substring, QLi for ( int i = 0; i < parentItem->rowCount(); ++i ) { + auto searchString = substring + "/"; + auto childItem = parentItem->child( i ); - if ( childItem && childItem->text().contains( substring, Qt::CaseInsensitive ) ) + if ( childItem ) { - matchingItems.append( childItem ); + auto textToMatch = childItem->text(); + textToMatch.replace( '\\', '/' ); + + if ( childItem && textToMatch.contains( searchString, Qt::CaseInsensitive ) ) + { + matchingItems.append( childItem ); + } } findItemsMatching( childItem, substring, matchingItems ); @@ -352,10 +360,10 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent, con &QStandardItemModel::itemChanged, []( QStandardItem* item ) { - if ( item->isCheckable() && item->checkState() == Qt::Unchecked ) + if ( item->isCheckable() ) { // If the item is a parent item, uncheck all its children - setCheckedStateChildItems( item, Qt::Unchecked ); + setCheckedStateChildItems( item, item->checkState() ); } } );