X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/cc3eb7d757c3016849217c4a3ccd0a9e52f70872..c72fdaa77380ef811dfef626a4edadbb824ed252:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index f747d442e..767f2ae8f 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -56,6 +55,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) : m_urlNavigator(nullptr), m_emptyTrashButton(nullptr), m_searchBox(nullptr), + m_searchModeEnabled(false), m_messageWidget(nullptr), m_view(nullptr), m_filterBar(nullptr), @@ -311,6 +311,10 @@ void DolphinViewContainer::showMessage(const QString& msg, MessageType type) m_messageWidget->setText(msg); + // TODO: wrap at arbitrary character positions once QLabel can do this + // https://bugreports.qt.io/browse/QTBUG-1276 + m_messageWidget->setWordWrap(true); + switch (type) { case Information: m_messageWidget->setMessageType(KMessageWidget::Information); break; case Warning: m_messageWidget->setMessageType(KMessageWidget::Warning); break; @@ -378,11 +382,13 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled) } m_urlNavigator->setLocationUrl(url); } + + m_searchModeEnabled = enabled; } bool DolphinViewContainer::isSearchModeEnabled() const { - return m_searchBox->isVisible(); + return m_searchModeEnabled; } QString DolphinViewContainer::placesText() const @@ -425,6 +431,15 @@ QString DolphinViewContainer::caption() const if (!matchedPlaces.isEmpty()) { return placesModel->text(matchedPlaces.first()); } + + if (isSearchModeEnabled()) { + if (currentSearchText().isEmpty()){ + return i18n("Search"); + } else { + return i18n("Search for %1", currentSearchText()); + } + } + if (!url().isLocalFile()) { QUrl adjustedUrl = url().adjusted(QUrl::StripTrailingSlash); QString caption; @@ -445,14 +460,6 @@ QString DolphinViewContainer::caption() const fileName = '/'; } - if (isSearchModeEnabled()) { - if(currentSearchText().isEmpty()){ - return i18n("Search"); - } else { - return i18n("Search for %1", currentSearchText()); - } - } - return fileName; } @@ -680,7 +687,6 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl& url) void DolphinViewContainer::slotUrlSelectionRequested(const QUrl& url) { - qCDebug(DolphinDebug) << "slotUrlSelectionRequested: " << url; m_view->markUrlsAsSelected({url}); m_view->markUrlAsCurrent(url); // makes the item scroll into view }