Commit c8c26858 authored by Craig Watson's avatar Craig Watson

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]"
parent 93b03b2e
......@@ -1465,7 +1465,10 @@ bool UBFeaturesPathProxyModel::filterAcceptsRow( int sourceRow, const QModelInde
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
UBFeature feature = sourceModel()->data(index, Qt::UserRole + 1).value<UBFeature>();
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()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment