summaryrefslogtreecommitdiffabout
path: root/korganizer/searchdialog.cpp
authorzautrix <zautrix>2005-07-06 14:24:16 (UTC)
committer zautrix <zautrix>2005-07-06 14:24:16 (UTC)
commit2e8199c8aa82c018d24d67c299a09b2aa6a786f1 (patch) (unidiff)
tree3883f4d664b632d4107333ca27ff47ef1abdb70a /korganizer/searchdialog.cpp
parentfeb7b5c7dbc5f9de44993330dee654ad0a38b8d9 (diff)
downloadkdepimpi-2e8199c8aa82c018d24d67c299a09b2aa6a786f1.zip
kdepimpi-2e8199c8aa82c018d24d67c299a09b2aa6a786f1.tar.gz
kdepimpi-2e8199c8aa82c018d24d67c299a09b2aa6a786f1.tar.bz2
fixxx
Diffstat (limited to 'korganizer/searchdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 2e32ac2..9cfdc35 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -225,64 +225,68 @@ void SearchDialog::raiseAndSelect()
225 mDescriptionCheck->setChecked( true ); 225 mDescriptionCheck->setChecked( true );
226 226
227 } 227 }
228 } 228 }
229 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 229 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
230 if ( ! mSearchTodo->isChecked() ) { 230 if ( ! mSearchTodo->isChecked() ) {
231 mSearchTodo->setChecked( true ); 231 mSearchTodo->setChecked( true );
232 mSearchJournal->setChecked( false ); 232 mSearchJournal->setChecked( false );
233 mSearchEvent->setChecked( false ); 233 mSearchEvent->setChecked( false );
234 } 234 }
235 } 235 }
236 else { 236 else {
237 if ( ! mSearchEvent->isChecked() ) { 237 if ( ! mSearchEvent->isChecked() ) {
238 mSearchEvent->setChecked( true ); 238 mSearchEvent->setChecked( true );
239 mSearchJournal->setChecked( false ); 239 mSearchJournal->setChecked( false );
240 mSearchTodo->setChecked( false ); 240 mSearchTodo->setChecked( false );
241 } 241 }
242 } 242 }
243 } 243 }
244 currentState = newState; 244 currentState = newState;
245 raise(); 245 raise();
246} 246}
247void SearchDialog::setFocusToList() 247void SearchDialog::setFocusToList()
248{ 248{
249 listView->resetFocus(); 249 listView->resetFocus();
250} 250}
251void SearchDialog::accept() 251void SearchDialog::accept()
252{ 252{
253 doSearch(); 253 doSearch();
254} 254}
255void SearchDialog::updateList() 255void SearchDialog::updateList()
256{ 256{
257 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
258 listView->clear();
259 return;
260 }
257 //listView->updateList(); 261 //listView->updateList();
258 if ( isVisible() ) { 262 if ( isVisible() ) {
259 updateView(); 263 updateView();
260 //qDebug("SearchDialog::updated "); 264 //qDebug("SearchDialog::updated ");
261 } 265 }
262 else { 266 else {
263 listView->clear(); 267 listView->clear();
264 //qDebug("SearchDialog::cleared "); 268 //qDebug("SearchDialog::cleared ");
265 269
266 } 270 }
267} 271}
268void SearchDialog::searchTextChanged( const QString &_text ) 272void SearchDialog::searchTextChanged( const QString &_text )
269{ 273{
270#if 0 274#if 0
271 enableButton( KDialogBase::User1, !_text.isEmpty() ); 275 enableButton( KDialogBase::User1, !_text.isEmpty() );
272#endif 276#endif
273} 277}
274 278
275void SearchDialog::doSearch() 279void SearchDialog::doSearch()
276{ 280{
277 QRegExp re; 281 QRegExp re;
278 re.setWildcard(true); // most people understand these better. 282 re.setWildcard(true); // most people understand these better.
279 re.setCaseSensitive(false); 283 re.setCaseSensitive(false);
280 QString st = searchEdit->text(); 284 QString st = searchEdit->text();
281 if ( st.right(1) != "*") 285 if ( st.right(1) != "*")
282 st += "*"; 286 st += "*";
283 re.setPattern(st); 287 re.setPattern(st);
284 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { 288 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) {
285 KMessageBox::sorry(this, 289 KMessageBox::sorry(this,
286 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); 290 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals"));
287 return; 291 return;
288 } 292 }