Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinviewcontainer.cpp
Show First 20 Lines • Show All 445 Lines • ▼ Show 20 Line(s) | |||||
446 | void DolphinViewContainer::reload() | 446 | void DolphinViewContainer::reload() | ||
447 | { | 447 | { | ||
448 | view()->reload(); | 448 | view()->reload(); | ||
449 | m_messageWidget->hide(); | 449 | m_messageWidget->hide(); | ||
450 | } | 450 | } | ||
451 | 451 | | |||
452 | QString DolphinViewContainer::caption() const | 452 | QString DolphinViewContainer::caption() const | ||
453 | { | 453 | { | ||
454 | if (isSearchModeEnabled()) { | ||||
455 | if (currentSearchText().isEmpty()){ | ||||
456 | return i18n("Search"); | ||||
457 | } else { | ||||
458 | return i18n("Search for %1", currentSearchText()); | ||||
459 | } | ||||
460 | } | ||||
461 | | ||||
454 | if (GeneralSettings::showFullPathInTitlebar()) { | 462 | if (GeneralSettings::showFullPathInTitlebar()) { | ||
455 | if (!url().isLocalFile()) { | 463 | if (!url().isLocalFile()) { | ||
456 | return url().adjusted(QUrl::StripTrailingSlash).toString(); | 464 | return url().adjusted(QUrl::StripTrailingSlash).toString(); | ||
457 | } | 465 | } | ||
458 | return url().adjusted(QUrl::StripTrailingSlash).path(); | 466 | return url().adjusted(QUrl::StripTrailingSlash).path(); | ||
459 | } | 467 | } | ||
460 | 468 | | |||
461 | KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); | 469 | KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); | ||
462 | const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QUrl(url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?")), 1, Qt::MatchRegExp); | 470 | const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QUrl(url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?")), 1, Qt::MatchRegExp); | ||
463 | 471 | | |||
464 | if (!matchedPlaces.isEmpty()) { | 472 | if (!matchedPlaces.isEmpty()) { | ||
465 | return placesModel->text(matchedPlaces.first()); | 473 | return placesModel->text(matchedPlaces.first()); | ||
466 | } | 474 | } | ||
467 | 475 | | |||
468 | if (isSearchModeEnabled()) { | | |||
469 | if (currentSearchText().isEmpty()){ | | |||
470 | return i18n("Search"); | | |||
471 | } else { | | |||
472 | return i18n("Search for %1", currentSearchText()); | | |||
473 | } | | |||
474 | } | | |||
475 | 476 | | |||
476 | if (!url().isLocalFile()) { | 477 | if (!url().isLocalFile()) { | ||
477 | QUrl adjustedUrl = url().adjusted(QUrl::StripTrailingSlash); | 478 | QUrl adjustedUrl = url().adjusted(QUrl::StripTrailingSlash); | ||
478 | QString caption; | 479 | QString caption; | ||
479 | if (!adjustedUrl.fileName().isEmpty()) { | 480 | if (!adjustedUrl.fileName().isEmpty()) { | ||
480 | caption = adjustedUrl.fileName(); | 481 | caption = adjustedUrl.fileName(); | ||
481 | } else if (!adjustedUrl.path().isEmpty() && adjustedUrl.path() != "/") { | 482 | } else if (!adjustedUrl.path().isEmpty() && adjustedUrl.path() != "/") { | ||
482 | caption = adjustedUrl.path(); | 483 | caption = adjustedUrl.path(); | ||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |