┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-01-19 14:25:08 +0000
committerPeter Penz <[email protected]>2009-01-19 14:25:08 +0000
commitd85a6ec6dd3a30784c07636a77ee502dd5dae4a2 (patch)
treebab21b2cabd4777d5ae52bff12d8e17118ef91ea /src/dolphinmainwindow.cpp
parentbe1298d9aabbcc18c8a2b1c697d2bca5e7c0a9f3 (diff)
Use a custom SearchWidget instead directly using a KLineEdit. Currently the DolphinSearchWidget acts as "playground" to test some ideas. If it works well it might be a good idea moving this widget as KSearchBox (?) to kdelibs, so that it can be used by the file dialog or other applications.
svn path=/trunk/KDE/kdebase/apps/; revision=913572
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 24e1a1f97..70c287869 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -28,6 +28,7 @@
#include "dolphinnewmenu.h"
#include "settings/dolphinsettings.h"
#include "settings/dolphinsettingsdialog.h"
+#include "dolphinsearchbox.h"
#include "dolphinstatusbar.h"
#include "dolphinviewcontainer.h"
#include "panels/folders/folderspanel.h"
@@ -92,7 +93,7 @@ DolphinMainWindow::DolphinMainWindow(int id) :
m_tabBar(0),
m_activeViewContainer(0),
m_centralWidgetLayout(0),
- m_searchBar(0),
+ m_searchBox(0),
m_id(id),
m_tabIndex(0),
m_viewTab(),
@@ -843,10 +844,9 @@ void DolphinMainWindow::slotTestCanDecode(const QDragMoveEvent* event, bool& can
canDecode = KUrl::List::canDecode(event->mimeData());
}
-void DolphinMainWindow::searchItems()
+void DolphinMainWindow::searchItems(const KUrl& url)
{
- const QString nepomukString = "nepomuksearch:/" + m_searchBar->text();
- m_activeViewContainer->setUrl(KUrl(nepomukString));
+ m_activeViewContainer->setUrl(url);
}
@@ -911,9 +911,8 @@ void DolphinMainWindow::init()
setupGUI(Keys | Save | Create | ToolBar);
- m_searchBar->setParent(toolBar("searchToolBar"));
- m_searchBar->setFont(KGlobalSettings::generalFont());
- m_searchBar->show();
+ m_searchBox->setParent(toolBar("searchToolBar"));
+ m_searchBox->show();
stateChanged("new_file");
@@ -1124,15 +1123,13 @@ void DolphinMainWindow::setupActions()
connect(openInNewWindow, SIGNAL(triggered()), this, SLOT(openInNewWindow()));
// 'Search' toolbar
- m_searchBar = new KLineEdit(this);
- m_searchBar->setMinimumWidth(150);
- m_searchBar->setClearButtonShown(true);
- connect(m_searchBar, SIGNAL(returnPressed()), this, SLOT(searchItems()));
+ m_searchBox = new DolphinSearchBox(this);
+ connect(m_searchBox, SIGNAL(search(KUrl)), this, SLOT(searchItems(KUrl)));
KAction* search = new KAction(this);
actionCollection()->addAction("search_bar", search);
search->setText(i18nc("@action:inmenu", "Search Bar"));
- search->setDefaultWidget(m_searchBar);
+ search->setDefaultWidget(m_searchBox);
search->setShortcutConfigurable(false);
}