summaryrefslogtreecommitdiff
path: root/core/pim/osearch/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/mainwindow.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index e15cc7e..33a24bc 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -89,4 +89,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
popupTimer = new QTimer();
+ searchTimer = new QTimer();
connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
+ connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
@@ -113,5 +115,6 @@ void MainWindow::makeMenu()
//SEARCH
- QAction *action = new QAction( tr("Search all"),QString::null, 0, this, 0 );
- connect( action, SIGNAL(activated()), this, SLOT(searchAll()) );
- action->addTo( searchMenu );
+ SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
+ SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
+ connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
+ SearchAllAction->addTo( searchMenu );
actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true );
@@ -125,2 +128,3 @@ void MainWindow::makeMenu()
searchBar->setStretchableWidget( searchEdit );
+ SearchAllAction->addTo( searchBar );
connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
@@ -186,3 +190,11 @@ void MainWindow::setSearch( const QString &key )
{
- QRegExp re( key, actionCaseSensitiv->isOn(), actionWildcards->isOn() );
+ searchTimer->stop();
+ _searchString = key;
+ searchTimer->start( 300 );
+}
+
+void MainWindow::searchStringChanged()
+{
+ searchTimer->stop();
+ QRegExp re( _searchString, actionCaseSensitiv->isOn(), actionWildcards->isOn() );
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() )
@@ -193,5 +205,5 @@ void MainWindow::searchAll()
{
- bool openState;
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
s->doSearch();
+ //resultsList->repaint();
}