From c8c2685838dc123d19e396466a18590a37a8c04d Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Wed, 7 Sep 2016 18:53:06 -0400 Subject: [PATCH] Fix nested folder bug In the right-hand pane, two folders that were at the same path and whose names started with the same characters were considered to be nested by the breadcrumbs trail. E.g, folders named "abc" and "abcd", both in the "Audio" folder: clicking on "abcd" made the breadcrumb trail display "[Audio] > [abc] > [abcd]" --- src/gui/UBFeaturesWidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 348ea771..fe3520c7 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -1464,8 +1464,11 @@ bool UBFeaturesPathProxyModel::filterAcceptsRow( int sourceRow, const QModelInde { QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); UBFeature feature = sourceModel()->data(index, Qt::UserRole + 1).value(); - - return feature.isFolder() && path.startsWith( feature.getFullVirtualPath()) ; + + // We want to display parent folders up to and including the current one + return (feature.isFolder() + && ( path.startsWith(feature.getFullVirtualPath() + "/") + || path == feature.getFullVirtualPath())); }