X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/848abc5922167a467bb73107ee6b72e9af3c8317..bff373d598c031cb1:/src/search/dolphinsearchbox.cpp diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 6cae37e19..9c41db9c5 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -21,31 +21,29 @@ #include "dolphin_searchsettings.h" #include "dolphinfacetswidget.h" +#include "panels/places/placesitemmodel.h" -#include - -#include -#include #include -#include #include +#include +#include +#ifdef HAVE_BALOO +#include +#include +#endif #include #include +#include #include +#include #include +#include #include #include #include #include -#include -#ifdef HAVE_BALOO - #include - #include -#endif -#include - DolphinSearchBox::DolphinSearchBox(QWidget* parent) : QWidget(parent), m_startedSearching(false), @@ -233,10 +231,14 @@ bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event) // #379135: we get the FocusIn event when we close a tab but we don't want to emit // the activated() signal before the removeTab() call in DolphinTabWidget::closeTab() returns. // To avoid this issue, we delay the activation of the search box. - QTimer::singleShot(0, this, [this] { - setActive(true); - setFocus(); - }); + // We also don't want to schedule the activation process if we are already active, + // otherwise we can enter in a loop of FocusIn/FocusOut events with the searchbox of another tab. + if (!isActive()) { + QTimer::singleShot(0, this, [this] { + setActive(true); + setFocus(); + }); + } break; default: @@ -380,7 +382,7 @@ void DolphinSearchBox::init() // Apply layout for the search input QHBoxLayout* searchInputLayout = new QHBoxLayout(); - searchInputLayout->setMargin(0); + searchInputLayout->setContentsMargins(0, 0, 0, 0); searchInputLayout->addWidget(closeButton); searchInputLayout->addWidget(m_searchLabel); searchInputLayout->addWidget(m_searchInput); @@ -440,7 +442,7 @@ void DolphinSearchBox::init() // Apply layout for the options QHBoxLayout* optionsLayout = new QHBoxLayout(); - optionsLayout->setMargin(0); + optionsLayout->setContentsMargins(0, 0, 0, 0); optionsLayout->addWidget(m_fileNameButton); optionsLayout->addWidget(m_contentButton); optionsLayout->addWidget(m_separator); @@ -466,7 +468,7 @@ void DolphinSearchBox::init() m_optionsScrollArea->setWidgetResizable(true); m_topLayout = new QVBoxLayout(this); - m_topLayout->setMargin(0); + m_topLayout->setContentsMargins(0, 0, 0, 0); m_topLayout->addLayout(searchInputLayout); m_topLayout->addWidget(m_optionsScrollArea); m_topLayout->addWidget(m_facetsWidget);