summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp2
-rw-r--r--korganizer/searchdialog.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 5bd7c6f..72ee1d2 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -293,103 +293,105 @@ void SearchDialog::search(const QRegExp &re)
293 } 293 }
294 } 294 }
295 } 295 }
296 } 296 }
297 } 297 }
298 } 298 }
299 QPtrList<Todo> todos = mCalendar->todos( ); 299 QPtrList<Todo> todos = mCalendar->todos( );
300 mMatchedTodos.clear(); 300 mMatchedTodos.clear();
301 if ( mSearchTodo->isChecked() ) { 301 if ( mSearchTodo->isChecked() ) {
302 Todo *tod; 302 Todo *tod;
303 for(tod=todos.first();tod;tod=todos.next()) { 303 for(tod=todos.first();tod;tod=todos.next()) {
304 if (mSummaryCheck->isChecked()) { 304 if (mSummaryCheck->isChecked()) {
305#if QT_VERSION >= 300 305#if QT_VERSION >= 300
306 if (re.search(tod->summary()) != -1) 306 if (re.search(tod->summary()) != -1)
307#else 307#else
308 if (re.match(tod->summary()) != -1) 308 if (re.match(tod->summary()) != -1)
309#endif 309#endif
310 { 310 {
311 mMatchedTodos.append(tod); 311 mMatchedTodos.append(tod);
312 continue; 312 continue;
313 } 313 }
314 } 314 }
315 if (mDescriptionCheck->isChecked()) { 315 if (mDescriptionCheck->isChecked()) {
316#if QT_VERSION >= 300 316#if QT_VERSION >= 300
317 if (re.search(tod->description()) != -1) 317 if (re.search(tod->description()) != -1)
318#else 318#else
319 if (re.match(tod->description()) != -1) 319 if (re.match(tod->description()) != -1)
320#endif 320#endif
321 { 321 {
322 mMatchedTodos.append(tod); 322 mMatchedTodos.append(tod);
323 continue; 323 continue;
324 } 324 }
325 } 325 }
326 if (mCategoryCheck->isChecked()) { 326 if (mCategoryCheck->isChecked()) {
327#if QT_VERSION >= 300 327#if QT_VERSION >= 300
328 if (re.search(tod->categoriesStr()) != -1) 328 if (re.search(tod->categoriesStr()) != -1)
329#else 329#else
330 if (re.match(tod->categoriesStr()) != -1) 330 if (re.match(tod->categoriesStr()) != -1)
331#endif 331#endif
332 { 332 {
333 mMatchedTodos.append(tod); 333 mMatchedTodos.append(tod);
334 continue; 334 continue;
335 } 335 }
336 } 336 }
337 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 337 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
338 QPtrList<Attendee> tmpAList = tod->attendees(); 338 QPtrList<Attendee> tmpAList = tod->attendees();
339 Attendee *a; 339 Attendee *a;
340 for (a = tmpAList.first(); a; a = tmpAList.next()) { 340 for (a = tmpAList.first(); a; a = tmpAList.next()) {
341 if (mSearchAName->isChecked()) { 341 if (mSearchAName->isChecked()) {
342#if QT_VERSION >= 300 342#if QT_VERSION >= 300
343 if (re.search(a->name()) != -1) 343 if (re.search(a->name()) != -1)
344#else 344#else
345 if (re.match(a->name()) != -1) 345 if (re.match(a->name()) != -1)
346#endif 346#endif
347 { 347 {
348 mMatchedTodos.append(tod); 348 mMatchedTodos.append(tod);
349 break; 349 break;
350 } 350 }
351 } 351 }
352 if (mSearchAEmail->isChecked()) { 352 if (mSearchAEmail->isChecked()) {
353#if QT_VERSION >= 300 353#if QT_VERSION >= 300
354 if (re.search(a->email()) != -1) 354 if (re.search(a->email()) != -1)
355#else 355#else
356 if (re.match(a->email()) != -1) 356 if (re.match(a->email()) != -1)
357#endif 357#endif
358 { 358 {
359 mMatchedTodos.append(tod); 359 mMatchedTodos.append(tod);
360 break; 360 break;
361 } 361 }
362 } 362 }
363 } 363 }
364 } 364 }
365 } 365 }
366 } 366 }
367 mMatchedJournals.clear(); 367 mMatchedJournals.clear();
368 if (mSearchJournal->isChecked() ) { 368 if (mSearchJournal->isChecked() ) {
369 QPtrList<Journal> journals = mCalendar->journals( ); 369 QPtrList<Journal> journals = mCalendar->journals( );
370 Journal* journ; 370 Journal* journ;
371 371
372 for(journ=journals.first();journ;journ=journals.next()) { 372 for(journ=journals.first();journ;journ=journals.next()) {
373 if ( journ->dtStart().date() <= mEndDate->date() 373 if ( journ->dtStart().date() <= mEndDate->date()
374 &&journ->dtStart().date() >= mStartDate->date()) { 374 &&journ->dtStart().date() >= mStartDate->date()) {
375#if QT_VERSION >= 300 375#if QT_VERSION >= 300
376 if (re.search(journ->description()) != -1) 376 if (re.search(journ->description()) != -1)
377#else 377#else
378 if (re.match(journ->description()) != -1) 378 if (re.match(journ->description()) != -1)
379#endif 379#endif
380 { 380 {
381 mMatchedJournals.append(journ); 381 mMatchedJournals.append(journ);
382 continue; 382 continue;
383 } 383 }
384 } 384 }
385 } 385 }
386 } 386 }
387 387
388} 388}
389/*
389void SearchDialog::keyPressEvent ( QKeyEvent *e) 390void SearchDialog::keyPressEvent ( QKeyEvent *e)
390{ 391{
391 392
392 e->ignore(); 393 e->ignore();
393 394
394} 395}
396*/
395//mMatchedJournals; 397//mMatchedJournals;
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index a03c586..ebcff7a 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -1,93 +1,93 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef SEARCHDIALOG_H 24#ifndef SEARCHDIALOG_H
25#define SEARCHDIALOG_H 25#define SEARCHDIALOG_H
26 26
27#include <qregexp.h> 27#include <qregexp.h>
28 28
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30 30
31#include <libkcal/calendar.h> 31#include <libkcal/calendar.h>
32 32
33#include "kolistview.h" 33#include "kolistview.h"
34 34
35class KDateEdit; 35class KDateEdit;
36class QCheckBox; 36class QCheckBox;
37class QLineEdit; 37class QLineEdit;
38class QLabel; 38class QLabel;
39class CalendarView; 39class CalendarView;
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43class SearchDialog : public KDialogBase 43class SearchDialog : public KDialogBase
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 public: 46 public:
47 SearchDialog(Calendar *calendar,CalendarView *parent=0); 47 SearchDialog(Calendar *calendar,CalendarView *parent=0);
48 virtual ~SearchDialog(); 48 virtual ~SearchDialog();
49 KOListView *listview(){ return listView;} 49 KOListView *listview(){ return listView;}
50 void updateView(); 50 void updateView();
51 51
52 public slots: 52 public slots:
53 void changeEventDisplay(Event *, int) { updateView(); } 53 void changeEventDisplay(Event *, int) { updateView(); }
54 void updateConfig(); 54 void updateConfig();
55 void updateList(); 55 void updateList();
56 protected slots: 56 protected slots:
57 void accept(); 57 void accept();
58 void doSearch(); 58 void doSearch();
59 void searchTextChanged( const QString &_text ); 59 void searchTextChanged( const QString &_text );
60 60
61 signals: 61 signals:
62 void showEventSignal(Event *); 62 void showEventSignal(Event *);
63 void editEventSignal(Event *); 63 void editEventSignal(Event *);
64 void deleteEventSignal(Event *); 64 void deleteEventSignal(Event *);
65 65
66 private: 66 private:
67 void search(const QRegExp &); 67 void search(const QRegExp &);
68 68
69 Calendar *mCalendar; 69 Calendar *mCalendar;
70 70
71 QPtrList<Event> mMatchedEvents; 71 QPtrList<Event> mMatchedEvents;
72 QPtrList<Todo> mMatchedTodos; 72 QPtrList<Todo> mMatchedTodos;
73 QPtrList<Journal> mMatchedJournals; 73 QPtrList<Journal> mMatchedJournals;
74 74
75 QLabel *searchLabel; 75 QLabel *searchLabel;
76 QLineEdit *searchEdit; 76 QLineEdit *searchEdit;
77 KOListView *listView; 77 KOListView *listView;
78 78
79 KDateEdit *mStartDate; 79 KDateEdit *mStartDate;
80 KDateEdit *mEndDate; 80 KDateEdit *mEndDate;
81 // QCheckBox *mInclusiveCheck; 81 // QCheckBox *mInclusiveCheck;
82 QCheckBox *mSummaryCheck; 82 QCheckBox *mSummaryCheck;
83 QCheckBox *mDescriptionCheck; 83 QCheckBox *mDescriptionCheck;
84 QCheckBox *mCategoryCheck; 84 QCheckBox *mCategoryCheck;
85 QCheckBox *mSearchEvent; 85 QCheckBox *mSearchEvent;
86 QCheckBox *mSearchTodo; 86 QCheckBox *mSearchTodo;
87 QCheckBox *mSearchJournal; 87 QCheckBox *mSearchJournal;
88 QCheckBox *mSearchAName; 88 QCheckBox *mSearchAName;
89 QCheckBox *mSearchAEmail; 89 QCheckBox *mSearchAEmail;
90 void keyPressEvent ( QKeyEvent *e) ; 90 //void keyPressEvent ( QKeyEvent *e) ;
91}; 91};
92 92
93#endif 93#endif