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]"
preferencesAboutTextFull
Craig Watson 8 years ago
parent 93b03b2ec1
commit c8c2685838
  1. 7
      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<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()));
}

Loading…
Cancel
Save