diff options
| author | Sascha Peilicke <[email protected]> | 2009-02-16 12:00:19 +0000 |
|---|---|---|
| committer | Sascha Peilicke <[email protected]> | 2009-02-16 12:00:19 +0000 |
| commit | 1f5f7f0092871fec525773a6cce158413e18a265 (patch) | |
| tree | d229aa90d4ccc4f9eaa129946625dc9065c6d45e | |
| parent | 106094673c347c92ac594c0679ca1eb71ae6fe20 (diff) | |
Applied patches to filterbar as discussed on review request 91 and 93.
svn path=/trunk/KDE/kdebase/apps/; revision=926845
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 2 | ||||
| -rw-r--r-- | src/filterbar.cpp | 6 | ||||
| -rw-r--r-- | src/filterbar.h | 5 |
3 files changed, 10 insertions, 3 deletions
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 |
