Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinviewcontainer.cpp
Show First 20 Lines • Show All 450 Lines • ▼ Show 20 Line(s) | 450 | { | |||
---|---|---|---|---|---|
451 | if (GeneralSettings::showFullPathInTitlebar()) { | 451 | if (GeneralSettings::showFullPathInTitlebar()) { | ||
452 | if (!url().isLocalFile()) { | 452 | if (!url().isLocalFile()) { | ||
453 | return url().adjusted(QUrl::StripTrailingSlash).toString(); | 453 | return url().adjusted(QUrl::StripTrailingSlash).toString(); | ||
454 | } | 454 | } | ||
455 | return url().adjusted(QUrl::StripTrailingSlash).path(); | 455 | return url().adjusted(QUrl::StripTrailingSlash).path(); | ||
456 | } | 456 | } | ||
457 | 457 | | |||
458 | KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); | 458 | KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); | ||
459 | const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, url(), 1, Qt::MatchExactly); | 459 | const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QUrl(url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?")), 1, Qt::MatchRegExp); | ||
elvisangelaccio: We should probably use `toString(QUrl::FullyEncoded)`, since this is how the URL is going to… | |||||
460 | 460 | | |||
461 | if (!matchedPlaces.isEmpty()) { | 461 | if (!matchedPlaces.isEmpty()) { | ||
462 | return placesModel->text(matchedPlaces.first()); | 462 | return placesModel->text(matchedPlaces.first()); | ||
463 | } | 463 | } | ||
464 | 464 | | |||
465 | if (isSearchModeEnabled()) { | 465 | if (isSearchModeEnabled()) { | ||
466 | if (currentSearchText().isEmpty()){ | 466 | if (currentSearchText().isEmpty()){ | ||
467 | return i18n("Search"); | 467 | return i18n("Search"); | ||
▲ Show 20 Lines • Show All 341 Lines • Show Last 20 Lines |
We should probably use toString(QUrl::FullyEncoded), since this is how the URL is going to end up in the bookmark XML file used by the places model.