+ setWindowTitle(schemePrefix + path);
+ return;
+ }
+
+ const auto& matchedPlaces = s_placesModel.match(s_placesModel.index(0,0), KFilePlacesModel::UrlRole, url, 1, Qt::MatchExactly);
+
+ if (!matchedPlaces.isEmpty()) {
+ setWindowTitle(s_placesModel.text(matchedPlaces.first()));
+ return;
+ }
+
+ QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
+ if (fileName.isEmpty()) {
+ fileName = '/';
+ }
+
+ if (m_activeViewContainer->isSearchModeEnabled()) {
+ if(m_activeViewContainer->currentSearchText().isEmpty()){
+ setWindowTitle(i18n("Search"));
+ } else {
+ const auto searchText = i18n("Search for %1", m_activeViewContainer->currentSearchText());
+ setWindowTitle(searchText);