diff options
| author | Peter Penz <[email protected]> | 2010-10-27 17:08:02 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-10-27 17:08:02 +0000 |
| commit | 4383f4238ee61668d82e45f08935a9b99892f16e (patch) | |
| tree | 3533b803dfb02f6a72157d1ded458fd684ec9a2f /src/dolphinmainwindow.cpp | |
| parent | e521e260b6c95242e87fad9f22a0faa696cfa948 (diff) | |
- Automatically show the filter-panel when a searching is done
- Remove filter-prototypes that conflict with the filterpanel
svn path=/trunk/KDE/kdebase/apps/; revision=1190445
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e44495015..3c6d4c722 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -116,7 +116,8 @@ DolphinMainWindow::DolphinMainWindow(int id) : m_actionHandler(0), m_remoteEncoding(0), m_settingsDialog(0), - m_lastHandleUrlStatJob(0) + m_lastHandleUrlStatJob(0), + m_filterDockIsTemporaryVisible(false) { // Workaround for a X11-issue in combination with KModifierInfo // (see DolphinContextMenu::initializeModifierKeyInfo() for @@ -571,6 +572,14 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event) settings.save(); + if (m_filterDockIsTemporaryVisible) { + QDockWidget* filterDock = findChild<QDockWidget*>("filterDock"); + if (filterDock != 0) { + filterDock->hide(); + } + m_filterDockIsTemporaryVisible = false; + } + KXmlGuiWindow::closeEvent(event); } @@ -1191,6 +1200,26 @@ void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable) newFileMenu()->setEnabled(isFolderWritable); } +void DolphinMainWindow::slotSearchModeChanged(bool enabled) +{ + QDockWidget* filterDock = findChild<QDockWidget*>("filterDock"); + if (filterDock == 0) { + return; + } + + if (enabled) { + if (!filterDock->isVisible()) { + m_filterDockIsTemporaryVisible = true; + } + filterDock->show(); + } else { + if (filterDock->isVisible() && m_filterDockIsTemporaryVisible) { + filterDock->hide(); + } + m_filterDockIsTemporaryVisible = false; + } +} + void DolphinMainWindow::openContextMenu(const KFileItem& item, const KUrl& url, const QList<QAction*>& customActions) @@ -1603,6 +1632,9 @@ void DolphinMainWindow::setupDockWidgets() if (firstRun) { infoDock->hide(); foldersDock->hide(); +#ifdef HAVE_NEPOMUK + filterDock->hide(); +#endif #ifndef Q_OS_WIN terminalDock->hide(); #endif @@ -1739,6 +1771,8 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container) this, SLOT(updateFilterBarAction(bool))); connect(container, SIGNAL(writeStateChanged(bool)), this, SLOT(slotWriteStateChanged(bool))); + connect(container, SIGNAL(searchModeChanged(bool)), + this, SLOT(slotSearchModeChanged(bool))); DolphinView* view = container->view(); connect(view, SIGNAL(selectionChanged(KFileItemList)), |
