- const auto &matchedPlaces = placesModel->match(placesModel->index(0, 0), KFilePlacesModel::UrlRole, url, 1, Qt::MatchExactly);
-
- return !matchedPlaces.isEmpty();
+ QModelIndex url_index = placesModel->closestItem(url);
+ return url_index.isValid() && placesModel->url(url_index).matches(url, QUrl::StripTrailingSlash);