mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
Update searchbox on URL changes (Fix D24369)
Summary: In D24369 I introduced a regression: Where now the searchbox is updated on url changes for search urls, it is not updated anymore for regular folders. The effect is that not-indexed folders can have the extra options enabled or vice-versa. This patch fixes it, moving back the updating logic to `setSearchModeEnable`. Test Plan: - Searchbox updates properly when changing between search urls and regular folders, either indexed or nor-indexed. Reviewers: #dolphin, elvisangelaccio Subscribers: kfm-devel, elvisangelaccio Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24376
This commit is contained in:
parent
b3120cb90e
commit
8599a42ac1
|
@ -385,6 +385,11 @@ bool DolphinViewContainer::isFilterBarVisible() const
|
||||||
|
|
||||||
void DolphinViewContainer::setSearchModeEnabled(bool enabled)
|
void DolphinViewContainer::setSearchModeEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
|
if (enabled) {
|
||||||
|
const QUrl& locationUrl = m_urlNavigator->locationUrl();
|
||||||
|
m_searchBox->fromSearchUrl(locationUrl);
|
||||||
|
}
|
||||||
|
|
||||||
if (enabled == isSearchModeEnabled()) {
|
if (enabled == isSearchModeEnabled()) {
|
||||||
if (enabled && !m_searchBox->hasFocus()) {
|
if (enabled && !m_searchBox->hasFocus()) {
|
||||||
m_searchBox->setFocus();
|
m_searchBox->setFocus();
|
||||||
|
@ -671,15 +676,11 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl& url)
|
||||||
slotReturnPressed();
|
slotReturnPressed();
|
||||||
|
|
||||||
if (KProtocolManager::supportsListing(url)) {
|
if (KProtocolManager::supportsListing(url)) {
|
||||||
const bool searchUrl = isSearchUrl(url);
|
setSearchModeEnabled(isSearchUrl(url));
|
||||||
if (searchUrl) {
|
|
||||||
m_searchBox->fromSearchUrl(url);
|
|
||||||
}
|
|
||||||
setSearchModeEnabled(searchUrl);
|
|
||||||
m_view->setUrl(url);
|
m_view->setUrl(url);
|
||||||
tryRestoreViewState();
|
tryRestoreViewState();
|
||||||
|
|
||||||
if (m_autoGrabFocus && isActive() && !searchUrl) {
|
if (m_autoGrabFocus && isActive() && !isSearchUrl(url)) {
|
||||||
// When an URL has been entered, the view should get the focus.
|
// When an URL has been entered, the view should get the focus.
|
||||||
// The focus must be requested asynchronously, as changing the URL might create
|
// The focus must be requested asynchronously, as changing the URL might create
|
||||||
// a new view widget.
|
// a new view widget.
|
||||||
|
|
Loading…
Reference in a new issue