-rw-r--r-- | korganizer/kotodoviewitem.cpp | 2 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.h | 2 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 2 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 22 | ||||
-rw-r--r-- | korganizer/timespanview.cpp | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index ead8628..21ecb73 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -19,97 +19,97 @@ | |||
19 | 19 | ||
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | #include <kdebug.h> | 21 | #include <kdebug.h> |
22 | #include <qapp.h> | 22 | #include <qapp.h> |
23 | 23 | ||
24 | #include <kiconloader.h> | 24 | #include <kiconloader.h> |
25 | #include "kotodoviewitem.h" | 25 | #include "kotodoviewitem.h" |
26 | #include "kotodoview.h" | 26 | #include "kotodoview.h" |
27 | #include "koprefs.h" | 27 | #include "koprefs.h" |
28 | 28 | ||
29 | KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) | 29 | KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) |
30 | : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 30 | : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
31 | { | 31 | { |
32 | construct(); | 32 | construct(); |
33 | } | 33 | } |
34 | 34 | ||
35 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) | 35 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) |
36 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 36 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
37 | { | 37 | { |
38 | construct(); | 38 | construct(); |
39 | } | 39 | } |
40 | 40 | ||
41 | QString KOTodoViewItem::key(int column,bool) const | 41 | QString KOTodoViewItem::key(int column,bool) const |
42 | { | 42 | { |
43 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); | 43 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); |
44 | if (it == mKeyMap.end()) { | 44 | if (it == mKeyMap.end()) { |
45 | return text(column).lower(); | 45 | return text(column).lower(); |
46 | } else { | 46 | } else { |
47 | return *it; | 47 | return *it; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | void KOTodoViewItem:: setup() | 51 | void KOTodoViewItem:: setup() |
52 | { | 52 | { |
53 | 53 | ||
54 | int h = 20; | 54 | int h = 20; |
55 | if ( listView () ) { | 55 | if ( listView () ) { |
56 | QFontMetrics fm ( listView ()->font () ); | 56 | QFontMetrics fm ( listView ()->font () ); |
57 | h = fm.height(); | 57 | h = fm.height(); |
58 | } | 58 | } |
59 | setHeight( h ); | 59 | setHeight( h ); |
60 | 60 | ||
61 | } | 61 | } |
62 | void KOTodoViewItem::setSortKey(int column,const QString &key) | 62 | void KOTodoViewItem::setSortKey(int column,const QString &key) |
63 | { | 63 | { |
64 | mKeyMap.insert(column,key); | 64 | mKeyMap.insert(column,key); |
65 | } | 65 | } |
66 | 66 | ||
67 | #if QT_VERSION >= 300 | 67 | #if QT_VERSION >= 0x030000 |
68 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, | 68 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, |
69 | int y,int h) | 69 | int y,int h) |
70 | { | 70 | { |
71 | QListViewItem::paintBranches(p,cg,w,y,h); | 71 | QListViewItem::paintBranches(p,cg,w,y,h); |
72 | } | 72 | } |
73 | #else | 73 | #else |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | void KOTodoViewItem::construct() | 76 | void KOTodoViewItem::construct() |
77 | { | 77 | { |
78 | // qDebug("KOTodoViewItem::construct() "); | 78 | // qDebug("KOTodoViewItem::construct() "); |
79 | m_init = true; | 79 | m_init = true; |
80 | QString keyd = "=="; | 80 | QString keyd = "=="; |
81 | QString keyt = "=="; | 81 | QString keyt = "=="; |
82 | QString skeyd = "=="; | 82 | QString skeyd = "=="; |
83 | QString skeyt = "=="; | 83 | QString skeyt = "=="; |
84 | 84 | ||
85 | setOn(mTodo->isCompleted()); | 85 | setOn(mTodo->isCompleted()); |
86 | setText(0,mTodo->summary()); | 86 | setText(0,mTodo->summary()); |
87 | setText(1,QString::number(mTodo->priority())); | 87 | setText(1,QString::number(mTodo->priority())); |
88 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); | 88 | setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); |
89 | if (mTodo->percentComplete()<100) { | 89 | if (mTodo->percentComplete()<100) { |
90 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 90 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
91 | else setSortKey(2,QString::number(mTodo->percentComplete())); | 91 | else setSortKey(2,QString::number(mTodo->percentComplete())); |
92 | } | 92 | } |
93 | else { | 93 | else { |
94 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 94 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
95 | else setSortKey(2,QString::number(99)); | 95 | else setSortKey(2,QString::number(99)); |
96 | } | 96 | } |
97 | if (mTodo->hasDueDate()) { | 97 | if (mTodo->hasDueDate()) { |
98 | setText(3, mTodo->dtDueDateStr()); | 98 | setText(3, mTodo->dtDueDateStr()); |
99 | QDate d = mTodo->dtDue().date(); | 99 | QDate d = mTodo->dtDue().date(); |
100 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 100 | keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
101 | // setSortKey(3,keyd); | 101 | // setSortKey(3,keyd); |
102 | if (mTodo->doesFloat()) { | 102 | if (mTodo->doesFloat()) { |
103 | setText(4,""); | 103 | setText(4,""); |
104 | } | 104 | } |
105 | else { | 105 | else { |
106 | setText(4,mTodo->dtDueTimeStr()); | 106 | setText(4,mTodo->dtDueTimeStr()); |
107 | QTime t = mTodo->dtDue().time(); | 107 | QTime t = mTodo->dtDue().time(); |
108 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); | 108 | keyt.sprintf("%02d%02d",t.hour(),t.minute()); |
109 | //setSortKey(4,keyt); | 109 | //setSortKey(4,keyt); |
110 | } | 110 | } |
111 | } else { | 111 | } else { |
112 | setText(3,""); | 112 | setText(3,""); |
113 | setText(4,""); | 113 | setText(4,""); |
114 | } | 114 | } |
115 | setSortKey(3,keyd); | 115 | setSortKey(3,keyd); |
diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h index 74dbe98..bd024c8 100644 --- a/korganizer/kotodoviewitem.h +++ b/korganizer/kotodoviewitem.h | |||
@@ -27,67 +27,67 @@ | |||
27 | #include <qlistbox.h> | 27 | #include <qlistbox.h> |
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qmap.h> | 30 | #include <qmap.h> |
31 | #include <qlistview.h> | 31 | #include <qlistview.h> |
32 | #include <qpainter.h> | 32 | #include <qpainter.h> |
33 | 33 | ||
34 | #include <libkcal/calendar.h> | 34 | #include <libkcal/calendar.h> |
35 | #include <libkcal/todo.h> | 35 | #include <libkcal/todo.h> |
36 | 36 | ||
37 | using namespace KCal; | 37 | using namespace KCal; |
38 | 38 | ||
39 | class KOTodoView; | 39 | class KOTodoView; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | This class provides a way of displaying a single Event of Todo-Type in a | 42 | This class provides a way of displaying a single Event of Todo-Type in a |
43 | KTodoView. | 43 | KTodoView. |
44 | 44 | ||
45 | @author Cornelius Schumacher <schumacher@kde.org> | 45 | @author Cornelius Schumacher <schumacher@kde.org> |
46 | @see KOTodoView | 46 | @see KOTodoView |
47 | */ | 47 | */ |
48 | class KOTodoViewItem : public QCheckListItem | 48 | class KOTodoViewItem : public QCheckListItem |
49 | { | 49 | { |
50 | public: | 50 | public: |
51 | /** | 51 | /** |
52 | Constructor. | 52 | Constructor. |
53 | 53 | ||
54 | @param parent is the list view to which this item belongs. | 54 | @param parent is the list view to which this item belongs. |
55 | @param ev is the event to have the item display information for. | 55 | @param ev is the event to have the item display information for. |
56 | */ | 56 | */ |
57 | KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); | 57 | KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); |
58 | KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); | 58 | KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); |
59 | //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} | 59 | //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} |
60 | 60 | ||
61 | void construct(); | 61 | void construct(); |
62 | 62 | ||
63 | Todo *todo() { return mTodo; } | 63 | Todo *todo() { return mTodo; } |
64 | 64 | ||
65 | QString key(int, bool) const; | 65 | QString key(int, bool) const; |
66 | 66 | ||
67 | void setSortKey(int column,const QString &key); | 67 | void setSortKey(int column,const QString &key); |
68 | 68 | ||
69 | bool isAlternate(); | 69 | bool isAlternate(); |
70 | 70 | ||
71 | virtual void paintCell(QPainter *p, const QColorGroup &cg, | 71 | virtual void paintCell(QPainter *p, const QColorGroup &cg, |
72 | int column, int width, int alignment); | 72 | int column, int width, int alignment); |
73 | virtual void setup(); | 73 | virtual void setup(); |
74 | protected: | 74 | protected: |
75 | #if QT_VERSION >= 300 | 75 | #if QT_VERSION >= 0x030000 |
76 | void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h); | 76 | void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h); |
77 | #else | 77 | #else |
78 | #endif | 78 | #endif |
79 | virtual void stateChange(bool); | 79 | virtual void stateChange(bool); |
80 | void setMyPixmap(); | 80 | void setMyPixmap(); |
81 | 81 | ||
82 | private: | 82 | private: |
83 | Todo *mTodo; | 83 | Todo *mTodo; |
84 | KOTodoView *mTodoView; | 84 | KOTodoView *mTodoView; |
85 | 85 | ||
86 | QMap<int,QString> mKeyMap; | 86 | QMap<int,QString> mKeyMap; |
87 | uint m_odd : 1; | 87 | uint m_odd : 1; |
88 | uint m_known : 1; | 88 | uint m_known : 1; |
89 | uint m_unused : 30; | 89 | uint m_unused : 30; |
90 | bool m_init; | 90 | bool m_init; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | #endif | 93 | #endif |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index f6b7718..e255b83 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -530,59 +530,59 @@ void KOViewManager::showJournalView() | |||
530 | if (!mJournalView) { | 530 | if (!mJournalView) { |
531 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), | 531 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), |
532 | "KOViewManager::JournalView"); | 532 | "KOViewManager::JournalView"); |
533 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, | 533 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, |
534 | SLOT( updateConfig() ) ); | 534 | SLOT( updateConfig() ) ); |
535 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); | 535 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); |
536 | addView(mJournalView); | 536 | addView(mJournalView); |
537 | } | 537 | } |
538 | 538 | ||
539 | showView(mJournalView); | 539 | showView(mJournalView); |
540 | } | 540 | } |
541 | 541 | ||
542 | void KOViewManager::showTimeSpanView() | 542 | void KOViewManager::showTimeSpanView() |
543 | { | 543 | { |
544 | //mFlagShowNextxDays = false; | 544 | //mFlagShowNextxDays = false; |
545 | if (!mTimeSpanView) { | 545 | if (!mTimeSpanView) { |
546 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), | 546 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), |
547 | "KOViewManager::TimeSpanView"); | 547 | "KOViewManager::TimeSpanView"); |
548 | addView(mTimeSpanView); | 548 | addView(mTimeSpanView); |
549 | 549 | ||
550 | mTimeSpanView->readSettings(); | 550 | mTimeSpanView->readSettings(); |
551 | } | 551 | } |
552 | 552 | ||
553 | showView(mTimeSpanView); | 553 | showView(mTimeSpanView); |
554 | } | 554 | } |
555 | 555 | ||
556 | Incidence *KOViewManager::currentSelection() | 556 | Incidence *KOViewManager::currentSelection() |
557 | { | 557 | { |
558 | if (!mCurrentView) return 0; | 558 | if (!mCurrentView) return 0; |
559 | if ( mCurrentView == mListView ) { | 559 | if ( mCurrentView == mListView ) { |
560 | if ( mListView->currentItem() ) | 560 | if ( mListView->currentItem() ) |
561 | return mListView->currentItem(); | 561 | return mListView->currentItem(); |
562 | } | 562 | } |
563 | return mCurrentView->selectedIncidences().first(); | 563 | return mCurrentView->selectedIncidences().first(); |
564 | } | 564 | } |
565 | 565 | ||
566 | QDate KOViewManager::currentSelectionDate() | 566 | QDate KOViewManager::currentSelectionDate() |
567 | { | 567 | { |
568 | QDate qd; | 568 | QDate qd; |
569 | if (mCurrentView) { | 569 | if (mCurrentView) { |
570 | DateList qvl = mCurrentView->selectedDates(); | 570 | DateList qvl = mCurrentView->selectedDates(); |
571 | if (!qvl.isEmpty()) qd = qvl.first(); | 571 | if (!qvl.isEmpty()) qd = qvl.first(); |
572 | } | 572 | } |
573 | return qd; | 573 | return qd; |
574 | } | 574 | } |
575 | 575 | ||
576 | void KOViewManager::addView(KOrg::BaseView *view) | 576 | void KOViewManager::addView(KOrg::BaseView *view) |
577 | { | 577 | { |
578 | #if QT_VERSION >= 300 | 578 | #if QT_VERSION >= 0x030000 |
579 | mMainView->viewStack()->addWidget( view ); | 579 | mMainView->viewStack()->addWidget( view ); |
580 | #else | 580 | #else |
581 | mMainView->viewStack()->addWidget( view, 1 ); | 581 | mMainView->viewStack()->addWidget( view, 1 ); |
582 | #endif | 582 | #endif |
583 | } | 583 | } |
584 | 584 | ||
585 | void KOViewManager::setDocumentId( const QString &id ) | 585 | void KOViewManager::setDocumentId( const QString &id ) |
586 | { | 586 | { |
587 | if (mTodoView) mTodoView->setDocumentId( id ); | 587 | if (mTodoView) mTodoView->setDocumentId( id ); |
588 | } | 588 | } |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 72ee1d2..39966b5 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -189,209 +189,209 @@ void SearchDialog::doSearch() | |||
189 | i18n("No event/todo were found matching\nyour search expression.\nUse the wildcard characters\n ' * ' and ' ? ' where needed.")); | 189 | i18n("No event/todo were found matching\nyour search expression.\nUse the wildcard characters\n ' * ' and ' ? ' where needed.")); |
190 | #ifndef DESKTOP_VERSION | 190 | #ifndef DESKTOP_VERSION |
191 | setCaption(i18n("Click OK to search ->")); | 191 | setCaption(i18n("Click OK to search ->")); |
192 | #else | 192 | #else |
193 | setCaption(i18n("KO/Pi Find ")); | 193 | setCaption(i18n("KO/Pi Find ")); |
194 | #endif | 194 | #endif |
195 | } else { | 195 | } else { |
196 | QString mess; | 196 | QString mess; |
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 | } |
202 | void SearchDialog::updateConfig() | 202 | void SearchDialog::updateConfig() |
203 | { | 203 | { |
204 | listView->updateConfig(); | 204 | listView->updateConfig(); |
205 | } | 205 | } |
206 | void SearchDialog::updateView() | 206 | void 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 | ||
226 | void SearchDialog::search(const QRegExp &re) | 226 | void 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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 >= 0x030000 |
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 | /* | 389 | /* |
390 | void SearchDialog::keyPressEvent ( QKeyEvent *e) | 390 | void SearchDialog::keyPressEvent ( QKeyEvent *e) |
391 | { | 391 | { |
392 | 392 | ||
393 | e->ignore(); | 393 | e->ignore(); |
394 | 394 | ||
395 | } | 395 | } |
396 | */ | 396 | */ |
397 | //mMatchedJournals; | 397 | //mMatchedJournals; |
diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp index 67a3811..df8ff88 100644 --- a/korganizer/timespanview.cpp +++ b/korganizer/timespanview.cpp | |||
@@ -60,97 +60,97 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : | |||
60 | mTimeLine,SLOT(setContentsPos(int))); | 60 | mTimeLine,SLOT(setContentsPos(int))); |
61 | } | 61 | } |
62 | 62 | ||
63 | TimeSpanView::~TimeSpanView() | 63 | TimeSpanView::~TimeSpanView() |
64 | { | 64 | { |
65 | } | 65 | } |
66 | 66 | ||
67 | QValueList<int> TimeSpanView::splitterSizes() | 67 | QValueList<int> TimeSpanView::splitterSizes() |
68 | { | 68 | { |
69 | return mSplitter->sizes(); | 69 | return mSplitter->sizes(); |
70 | } | 70 | } |
71 | 71 | ||
72 | void TimeSpanView::setSplitterSizes( QValueList<int> sizes ) | 72 | void TimeSpanView::setSplitterSizes( QValueList<int> sizes ) |
73 | { | 73 | { |
74 | mSplitter->setSizes( sizes ); | 74 | mSplitter->setSizes( sizes ); |
75 | } | 75 | } |
76 | 76 | ||
77 | void TimeSpanView::addItem( KCal::Event *event ) | 77 | void TimeSpanView::addItem( KCal::Event *event ) |
78 | { | 78 | { |
79 | new QListViewItem( mList, event->summary() ); | 79 | new QListViewItem( mList, event->summary() ); |
80 | 80 | ||
81 | QDateTime startDt = event->dtStart(); | 81 | QDateTime startDt = event->dtStart(); |
82 | QDateTime endDt = event->dtEnd(); | 82 | QDateTime endDt = event->dtEnd(); |
83 | 83 | ||
84 | // kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString() | 84 | // kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString() |
85 | // << " end: " << endDt.toString() << endl; | 85 | // << " end: " << endDt.toString() << endl; |
86 | 86 | ||
87 | int startSecs = mStartDate.secsTo( startDt ); | 87 | int startSecs = mStartDate.secsTo( startDt ); |
88 | int durationSecs = startDt.secsTo( endDt ); | 88 | int durationSecs = startDt.secsTo( endDt ); |
89 | 89 | ||
90 | // kdDebug() << "--- startSecs: " << startSecs << " dur: " << durationSecs << endl; | 90 | // kdDebug() << "--- startSecs: " << startSecs << " dur: " << durationSecs << endl; |
91 | 91 | ||
92 | int startX = mStartDate.secsTo( startDt ) / mSecsPerPixel; | 92 | int startX = mStartDate.secsTo( startDt ) / mSecsPerPixel; |
93 | int endX = startX + startDt.secsTo( endDt ) / mSecsPerPixel; | 93 | int endX = startX + startDt.secsTo( endDt ) / mSecsPerPixel; |
94 | 94 | ||
95 | // kdDebug() << "TimeSpanView::addItem(): s: " << startX << " e: " << endX << endl; | 95 | // kdDebug() << "TimeSpanView::addItem(): s: " << startX << " e: " << endX << endl; |
96 | 96 | ||
97 | mLineView->addLine( startX, endX ); | 97 | mLineView->addLine( startX, endX ); |
98 | } | 98 | } |
99 | 99 | ||
100 | void TimeSpanView::clear() | 100 | void TimeSpanView::clear() |
101 | { | 101 | { |
102 | mList->clear(); | 102 | mList->clear(); |
103 | mLineView->clear(); | 103 | mLineView->clear(); |
104 | } | 104 | } |
105 | 105 | ||
106 | void TimeSpanView::updateView() | 106 | void TimeSpanView::updateView() |
107 | { | 107 | { |
108 | #if QT_VERSION >= 300 | 108 | #if QT_VERSION >= 0x030000 |
109 | mLineView->updateContents(); | 109 | mLineView->updateContents(); |
110 | mTimeLine->updateContents(); | 110 | mTimeLine->updateContents(); |
111 | #else | 111 | #else |
112 | #endif | 112 | #endif |
113 | } | 113 | } |
114 | 114 | ||
115 | void TimeSpanView::setDateRange( const QDateTime &start, const QDateTime &end ) | 115 | void TimeSpanView::setDateRange( const QDateTime &start, const QDateTime &end ) |
116 | { | 116 | { |
117 | mStartDate = start; | 117 | mStartDate = start; |
118 | mEndDate = end; | 118 | mEndDate = end; |
119 | 119 | ||
120 | mTimeLine->setDateRange( start, end ); | 120 | mTimeLine->setDateRange( start, end ); |
121 | 121 | ||
122 | mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mLineView->pixelWidth(); | 122 | mSecsPerPixel = mStartDate.secsTo( mEndDate ) / mLineView->pixelWidth(); |
123 | } | 123 | } |
124 | 124 | ||
125 | QDateTime TimeSpanView::startDateTime() | 125 | QDateTime TimeSpanView::startDateTime() |
126 | { | 126 | { |
127 | return mStartDate; | 127 | return mStartDate; |
128 | } | 128 | } |
129 | 129 | ||
130 | QDateTime TimeSpanView::endDateTime() | 130 | QDateTime TimeSpanView::endDateTime() |
131 | { | 131 | { |
132 | return mEndDate; | 132 | return mEndDate; |
133 | } | 133 | } |
134 | 134 | ||
135 | void TimeSpanView::zoomIn() | 135 | void TimeSpanView::zoomIn() |
136 | { | 136 | { |
137 | int span = mStartDate.daysTo( mEndDate ); | 137 | int span = mStartDate.daysTo( mEndDate ); |
138 | setDateRange( mStartDate.addDays( span / 4 ), mEndDate.addDays( span / -4 ) ); | 138 | setDateRange( mStartDate.addDays( span / 4 ), mEndDate.addDays( span / -4 ) ); |
139 | 139 | ||
140 | emit dateRangeChanged(); | 140 | emit dateRangeChanged(); |
141 | } | 141 | } |
142 | 142 | ||
143 | void TimeSpanView::zoomOut() | 143 | void TimeSpanView::zoomOut() |
144 | { | 144 | { |
145 | int span = mStartDate.daysTo( mEndDate ); | 145 | int span = mStartDate.daysTo( mEndDate ); |
146 | setDateRange( mStartDate.addDays( span / -4 ), mEndDate.addDays( span / 4 ) ); | 146 | setDateRange( mStartDate.addDays( span / -4 ), mEndDate.addDays( span / 4 ) ); |
147 | 147 | ||
148 | emit dateRangeChanged(); | 148 | emit dateRangeChanged(); |
149 | } | 149 | } |
150 | 150 | ||
151 | void TimeSpanView::centerView() | 151 | void TimeSpanView::centerView() |
152 | { | 152 | { |
153 | QScrollBar *scrollBar = mLineView->horizontalScrollBar(); | 153 | QScrollBar *scrollBar = mLineView->horizontalScrollBar(); |
154 | int min = scrollBar->minValue(); | 154 | int min = scrollBar->minValue(); |
155 | int max = scrollBar->maxValue(); | 155 | int max = scrollBar->maxValue(); |
156 | scrollBar->setValue( min + (max-min) / 2 ); | 156 | scrollBar->setValue( min + (max-min) / 2 ); |