dolphinmainwindow.cpp
dolphinnewmenu.cpp
dolphinviewcontainer.cpp
- dolphinsearchbox.cpp
dolphindirlister.cpp
dolphincontextmenu.cpp
filterbar.cpp
panels/folders/treeviewcontextmenu.cpp
panels/folders/folderspanel.cpp
panels/folders/paneltreeview.cpp
+ search/dolphinsearchbox.cpp
settings/behaviorsettingspage.cpp
settings/columnviewsettingspage.cpp
settings/contextmenusettingspage.cpp
install( FILES dolphin.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES settings/dolphin_directoryviewpropertysettings.kcfg settings/dolphin_generalsettings.kcfg settings/dolphin_columnmodesettings.kcfg settings/dolphin_iconsmodesettings.kcfg settings/dolphin_detailsmodesettings.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES dolphinui.rc DESTINATION ${DATA_INSTALL_DIR}/dolphin )
-install( FILES dolphinsearchcommands.desktop DESTINATION ${DATA_INSTALL_DIR}/dolphin )
+install( FILES search/dolphinsearchcommands.desktop DESTINATION ${DATA_INSTALL_DIR}/dolphin )
install( FILES kcm/kcmdolphinviewmodes.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kcm/kcmdolphinnavigation.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kcm/kcmdolphinservices.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
#include "dolphinapplication.h"
#include "dolphinnewmenu.h"
+#include "search/dolphinsearchbox.h"
#include "settings/dolphinsettings.h"
#include "settings/dolphinsettingsdialog.h"
-#include "dolphinsearchbox.h"
#include "dolphinviewcontainer.h"
#include "panels/folders/folderspanel.h"
#include "panels/places/placespanel.h"
#ifdef HAVE_NEPOMUK
#include <Nepomuk/ResourceManager>
#include <Nepomuk/Tag>
-#endif //HAVE_NEPOMUK
-
+#endif
DolphinSearchCompleter::DolphinSearchCompleter(KLineEdit* linedit) :
QObject(0),
m_completionModel(0),
m_wordStart(-1),
m_wordEnd(-1)
-{
-}
-
-void DolphinSearchCompleter::init()
{
m_completionModel = new QStandardItemModel(this);
}
#endif //HAVE_NEPOMUK
- //load the completions stored in the desktop file
+ // load the completions stored in the desktop file
KDesktopFile file(KStandardDirs::locate("data", "dolphin/dolphinsearchcommands.desktop"));
foreach (const QString &group, file.groupList()) {
KConfigGroup cg(&file, group);
*wordStart = -1;
*wordEnd = -1;
- //the word might contain "" and thus maybe spaces
+ // the word might contain "" and thus maybe spaces
if (input.contains('\"')) {
int tempStart = -1;
int tempEnd = -1;
m_searchInput->setClearButtonShown(true);
m_searchInput->setMinimumWidth(150);
m_searchInput->setClickMessage(i18nc("@label:textbox", "Search..."));
+ m_searchInput->installEventFilter(this);
hLayout->addWidget(m_searchInput);
+ connect(m_searchInput, SIGNAL(textEdited(const QString&)),
+ this, SLOT(slotTextEdited(const QString&)));
connect(m_searchInput, SIGNAL(returnPressed()),
this, SLOT(emitSearchSignal()));
- m_completer = new DolphinSearchCompleter(m_searchInput);
- m_completer->init();
-
m_searchButton = new QToolButton(this);
m_searchButton->setAutoRaise(true);
m_searchButton->setIcon(KIcon("edit-find"));
DolphinSearchBox::~DolphinSearchBox()
{
- delete m_completer;
}
bool DolphinSearchBox::event(QEvent* event)
return QWidget::event(event);
}
+bool DolphinSearchBox::eventFilter(QObject* watched, QEvent* event)
+{
+ if ((watched == m_searchInput) && (event->type() == QEvent::FocusIn)) {
+ // Postpone the creation of the search completer until
+ // the search box is used. This decreases the startup time
+ // of Dolphin.
+ Q_ASSERT(m_completer == 0);
+ m_completer = new DolphinSearchCompleter(m_searchInput);
+ m_searchInput->removeEventFilter(this);
+ }
+
+ return QWidget::eventFilter(watched, event);
+}
+
+
void DolphinSearchBox::emitSearchSignal()
{
emit search(KUrl("nepomuksearch:/" + m_searchInput->text()));
}
+void DolphinSearchBox::slotTextEdited(const QString& text)
+{
+}
+
#include "dolphinsearchbox.moc"