From: Sascha Peilicke Date: Mon, 16 Feb 2009 12:00:19 +0000 (+0000) Subject: Applied patches to filterbar as discussed on review request 91 and 93. X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/1f5f7f0092871fec525773a6cce158413e18a265?ds=inline Applied patches to filterbar as discussed on review request 91 and 93. svn path=/trunk/KDE/kdebase/apps/; revision=926845 --- diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index bc2c44c07..9da51a60c 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -158,6 +158,8 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow, this, SLOT(setNameFilter(const QString&))); connect(m_filterBar, SIGNAL(closeRequest()), this, SLOT(closeFilterBar())); + connect(m_view, SIGNAL(urlChanged(const KUrl&)), + m_filterBar, SLOT(clear())); m_topLayout->addWidget(m_urlNavigator); m_topLayout->addWidget(m_view); diff --git a/src/filterbar.cpp b/src/filterbar.cpp index a16df75aa..7becada99 100644 --- a/src/filterbar.cpp +++ b/src/filterbar.cpp @@ -76,7 +76,11 @@ void FilterBar::keyReleaseEvent(QKeyEvent* event) { QWidget::keyReleaseEvent(event); if ((event->key() == Qt::Key_Escape)) { - emit closeRequest(); + if (m_filterInput->text().isEmpty()) { + emit closeRequest(); + } else { + m_filterInput->clear(); + } } } diff --git a/src/filterbar.h b/src/filterbar.h index 87aaa017e..e7c244e8c 100644 --- a/src/filterbar.h +++ b/src/filterbar.h @@ -39,10 +39,11 @@ class FilterBar : public QWidget public: FilterBar(QWidget* parent = 0); virtual ~FilterBar(); - + +public slots: /** Clears the input field. */ void clear(); - + signals: /** * Signal that reports the name filter has been