summaryrefslogtreecommitdiff
path: root/core/pim/osearch/mainwindow.cpp
Unidiff
Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (show 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 ) :
89 popupTimer = new QTimer(); 89 popupTimer = new QTimer();
90 searchTimer = new QTimer();
90 91
91 connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); 92 connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
93 connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
92 connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); 94 connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
@@ -113,5 +115,6 @@ void MainWindow::makeMenu()
113 //SEARCH 115 //SEARCH
114 QAction *action = new QAction( tr("Search all"),QString::null, 0, this, 0 ); 116 SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
115 connect( action, SIGNAL(activated()), this, SLOT(searchAll()) ); 117 SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
116 action->addTo( searchMenu ); 118 connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
119 SearchAllAction->addTo( searchMenu );
117 actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); 120 actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true );
@@ -125,2 +128,3 @@ void MainWindow::makeMenu()
125 searchBar->setStretchableWidget( searchEdit ); 128 searchBar->setStretchableWidget( searchEdit );
129 SearchAllAction->addTo( searchBar );
126 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 130 connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
@@ -186,3 +190,11 @@ void MainWindow::setSearch( const QString &key )
186{ 190{
187 QRegExp re( key, actionCaseSensitiv->isOn(), actionWildcards->isOn() ); 191 searchTimer->stop();
192 _searchString = key;
193 searchTimer->start( 300 );
194}
195
196void MainWindow::searchStringChanged()
197{
198 searchTimer->stop();
199 QRegExp re( _searchString, actionCaseSensitiv->isOn(), actionWildcards->isOn() );
188 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) 200 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() )
@@ -193,5 +205,5 @@ void MainWindow::searchAll()
193{ 205{
194 bool openState;
195 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ 206 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
196 s->doSearch(); 207 s->doSearch();
208 //resultsList->repaint();
197 } 209 }