summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-21 16:05:23 (UTC)
committer zautrix <zautrix>2005-01-21 16:05:23 (UTC)
commit5cbac3131e5cecde6042db12ca73d5cd72fbed77 (patch) (unidiff)
tree66af1682531c9e144dd6c346cd96851ad5112fb9
parent4afdcfcac216b428ada79f4750cf7447e3175333 (diff)
downloadkdepimpi-5cbac3131e5cecde6042db12ca73d5cd72fbed77.zip
kdepimpi-5cbac3131e5cecde6042db12ca73d5cd72fbed77.tar.gz
kdepimpi-5cbac3131e5cecde6042db12ca73d5cd72fbed77.tar.bz2
remove keyevent from seardialog
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
@@ -197,199 +197,201 @@ void SearchDialog::doSearch()
197 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); 197 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() );
198 setCaption( i18n("KO/Pi Find: ") + mess); 198 setCaption( i18n("KO/Pi Find: ") + mess);
199 199
200 } 200 }
201} 201}
202void SearchDialog::updateConfig() 202void SearchDialog::updateConfig()
203{ 203{
204 listView->updateConfig(); 204 listView->updateConfig();
205} 205}
206void SearchDialog::updateView() 206void SearchDialog::updateView()
207{ 207{
208 208
209 QRegExp re; 209 QRegExp re;
210 re.setWildcard(true); // most people understand these better. 210 re.setWildcard(true); // most people understand these better.
211 re.setCaseSensitive(false); 211 re.setCaseSensitive(false);
212 re.setPattern(searchEdit->text()); 212 re.setPattern(searchEdit->text());
213 if (re.isValid()) { 213 if (re.isValid()) {
214 search(re); 214 search(re);
215 } else { 215 } else {
216 mMatchedEvents.clear(); 216 mMatchedEvents.clear();
217 mMatchedTodos.clear(); 217 mMatchedTodos.clear();
218 mMatchedJournals.clear(); 218 mMatchedJournals.clear();
219 } 219 }
220 listView->setStartDate( mStartDate->date() ); 220 listView->setStartDate( mStartDate->date() );
221 listView->showEvents(mMatchedEvents); 221 listView->showEvents(mMatchedEvents);
222 listView->addTodos(mMatchedTodos); 222 listView->addTodos(mMatchedTodos);
223 listView->addJournals(mMatchedJournals); 223 listView->addJournals(mMatchedJournals);
224} 224}
225 225
226void SearchDialog::search(const QRegExp &re) 226void SearchDialog::search(const QRegExp &re)
227{ 227{
228 QPtrList<Event> events = mCalendar->events( mStartDate->date(), 228 QPtrList<Event> events = mCalendar->events( mStartDate->date(),
229 mEndDate->date(), 229 mEndDate->date(),
230 false /*mInclusiveCheck->isChecked()*/ ); 230 false /*mInclusiveCheck->isChecked()*/ );
231 231
232 mMatchedEvents.clear(); 232 mMatchedEvents.clear();
233 if ( mSearchEvent->isChecked() ) { 233 if ( mSearchEvent->isChecked() ) {
234 Event *ev; 234 Event *ev;
235 for(ev=events.first();ev;ev=events.next()) { 235 for(ev=events.first();ev;ev=events.next()) {
236 if (mSummaryCheck->isChecked()) { 236 if (mSummaryCheck->isChecked()) {
237#if QT_VERSION >= 300 237#if QT_VERSION >= 300
238 if (re.search(ev->summary()) != -1) 238 if (re.search(ev->summary()) != -1)
239#else 239#else
240 if (re.match(ev->summary()) != -1) 240 if (re.match(ev->summary()) != -1)
241#endif 241#endif
242 { 242 {
243 mMatchedEvents.append(ev); 243 mMatchedEvents.append(ev);
244 continue; 244 continue;
245 } 245 }
246 } 246 }
247 if (mDescriptionCheck->isChecked()) { 247 if (mDescriptionCheck->isChecked()) {
248#if QT_VERSION >= 300 248#if QT_VERSION >= 300
249 if (re.search(ev->description()) != -1) 249 if (re.search(ev->description()) != -1)
250#else 250#else
251 if (re.match(ev->description()) != -1) 251 if (re.match(ev->description()) != -1)
252#endif 252#endif
253 { 253 {
254 mMatchedEvents.append(ev); 254 mMatchedEvents.append(ev);
255 continue; 255 continue;
256 } 256 }
257 } 257 }
258 if (mCategoryCheck->isChecked()) { 258 if (mCategoryCheck->isChecked()) {
259#if QT_VERSION >= 300 259#if QT_VERSION >= 300
260 if (re.search(ev->categoriesStr()) != -1) 260 if (re.search(ev->categoriesStr()) != -1)
261#else 261#else
262 if (re.match(ev->categoriesStr()) != -1) 262 if (re.match(ev->categoriesStr()) != -1)
263#endif 263#endif
264 { 264 {
265 mMatchedEvents.append(ev); 265 mMatchedEvents.append(ev);
266 continue; 266 continue;
267 } 267 }
268 } 268 }
269 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { 269 if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) {
270 QPtrList<Attendee> tmpAList = ev->attendees(); 270 QPtrList<Attendee> tmpAList = ev->attendees();
271 Attendee *a; 271 Attendee *a;
272 for (a = tmpAList.first(); a; a = tmpAList.next()) { 272 for (a = tmpAList.first(); a; a = tmpAList.next()) {
273 if (mSearchAName->isChecked()) { 273 if (mSearchAName->isChecked()) {
274#if QT_VERSION >= 300 274#if QT_VERSION >= 300
275 if (re.search(a->name()) != -1) 275 if (re.search(a->name()) != -1)
276#else 276#else
277 if (re.match(a->name()) != -1) 277 if (re.match(a->name()) != -1)
278#endif 278#endif
279 { 279 {
280 mMatchedEvents.append(ev); 280 mMatchedEvents.append(ev);
281 break; 281 break;
282 } 282 }
283 } 283 }
284 if (mSearchAEmail->isChecked()) { 284 if (mSearchAEmail->isChecked()) {
285#if QT_VERSION >= 300 285#if QT_VERSION >= 300
286 if (re.search(a->email()) != -1) 286 if (re.search(a->email()) != -1)
287#else 287#else
288 if (re.match(a->email()) != -1) 288 if (re.match(a->email()) != -1)
289#endif 289#endif
290 { 290 {
291 mMatchedEvents.append(ev); 291 mMatchedEvents.append(ev);
292 break; 292 break;
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