From 702429ac8e64a5aff4e110a56f526b96ecb795fd Mon Sep 17 00:00:00 2001 From: Julian Schraner Date: Sun, 3 Dec 2017 07:58:02 -0700 Subject: Change window title when searching Summary: When you search for a file (e.g. "hello world") the window title of Dolphin will now change to "Search for [input]" instead of "baloosearch - /". BUG: 321575 Test Plan: - Disables it iself after search bar is hidden - Works with multiple word searches Reviewers: #dolphin, ngraham, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: anthonyfieroni, elvisangelaccio, rkflx, emmanuelp, ngraham, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D8273 --- src/dolphinmainwindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index de43bab4c..067d4a6e1 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1001,6 +1001,16 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url) fileName = '/'; } + if (m_activeViewContainer->isSearchModeEnabled()) { + if(m_activeViewContainer->currentSearchText().isEmpty()){ + setWindowTitle(i18n("Empty Search")); + } else { + const auto searchText = i18n("Search for %1", m_activeViewContainer->currentSearchText()); + setWindowTitle(searchText); + } + return; + } + setWindowTitle(schemePrefix + fileName); } -- cgit v1.3