author | zautrix <zautrix> | 2005-04-17 17:29:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-17 17:29:12 (UTC) |
commit | e3e76014e70643b0828f30f5c5277e212495d37c (patch) (unidiff) | |
tree | 6c1b65d08bbecf7f5d83db636cebe3425b1521e8 | |
parent | 70b45fe97813c4fd336b7ca8fdedab13f9c2e039 (diff) | |
download | kdepimpi-e3e76014e70643b0828f30f5c5277e212495d37c.zip kdepimpi-e3e76014e70643b0828f30f5c5277e212495d37c.tar.gz kdepimpi-e3e76014e70643b0828f30f5c5277e212495d37c.tar.bz2 |
fixes
-rw-r--r-- | korganizer/kolistview.cpp | 13 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 3 | ||||
-rw-r--r-- | libkcal/alarm.cpp | 2 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index e1b393d..a1bf9ff 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -92,13 +92,12 @@ ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | |||
92 | ListItemVisitor::~ListItemVisitor() | 92 | ListItemVisitor::~ListItemVisitor() |
93 | { | 93 | { |
94 | } | 94 | } |
95 | 95 | ||
96 | bool ListItemVisitor::visit(Event *e) | 96 | bool ListItemVisitor::visit(Event *e) |
97 | { | 97 | { |
98 | |||
99 | bool ok = false; | 98 | bool ok = false; |
100 | QString start, end; | 99 | QString start, end; |
101 | QDate ds, de; | 100 | QDate ds, de; |
102 | if ( e->doesRecur() ) { | 101 | if ( e->doesRecur() ) { |
103 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 102 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
104 | if ( ok ) { | 103 | if ( ok ) { |
@@ -123,12 +122,14 @@ bool ListItemVisitor::visit(Event *e) | |||
123 | if ( e->isAlarmEnabled() ) { | 122 | if ( e->isAlarmEnabled() ) { |
124 | mItem->setText(5,e->alarms().first()->offsetText() ); | 123 | mItem->setText(5,e->alarms().first()->offsetText() ); |
125 | } else { | 124 | } else { |
126 | mItem->setText(5, i18n("No")); | 125 | mItem->setText(5, i18n("No")); |
127 | } | 126 | } |
128 | mItem->setText(6, e->recurrence()->recurrenceText()); | 127 | mItem->setText(6, e->recurrence()->recurrenceText()); |
128 | if( ! e->doesRecur() ) | ||
129 | mItem->setSortKey( 6, "-" ); | ||
129 | mItem->setText(7,"---"); | 130 | mItem->setText(7,"---"); |
130 | mItem->setText(8,"---"); | 131 | mItem->setText(8,"---"); |
131 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 132 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
132 | mItem->setText(10,e->categoriesStr()); | 133 | mItem->setText(10,e->categoriesStr()); |
133 | 134 | ||
134 | QString key; | 135 | QString key; |
@@ -136,13 +137,12 @@ bool ListItemVisitor::visit(Event *e) | |||
136 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 137 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
137 | mItem->setSortKey(1,key); | 138 | mItem->setSortKey(1,key); |
138 | 139 | ||
139 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 140 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
140 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 141 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
141 | mItem->setSortKey(3,key); | 142 | mItem->setSortKey(3,key); |
142 | |||
143 | return true; | 143 | return true; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool ListItemVisitor::visit(Todo *t) | 146 | bool ListItemVisitor::visit(Todo *t) |
147 | { | 147 | { |
148 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); | 148 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); |
@@ -162,12 +162,14 @@ bool ListItemVisitor::visit(Todo *t) | |||
162 | if ( t->isAlarmEnabled() ) { | 162 | if ( t->isAlarmEnabled() ) { |
163 | mItem->setText(5,t->alarms().first()->offsetText() ); | 163 | mItem->setText(5,t->alarms().first()->offsetText() ); |
164 | } else { | 164 | } else { |
165 | mItem->setText(5, i18n("No")); | 165 | mItem->setText(5, i18n("No")); |
166 | } | 166 | } |
167 | mItem->setText(6, t->recurrence()->recurrenceText()); | 167 | mItem->setText(6, t->recurrence()->recurrenceText()); |
168 | if( ! t->doesRecur() ) | ||
169 | mItem->setSortKey( 6, "-" ); | ||
168 | if (t->hasDueDate()) { | 170 | if (t->hasDueDate()) { |
169 | mItem->setText(7,t->dtDueDateStr()); | 171 | mItem->setText(7,t->dtDueDateStr()); |
170 | if (t->doesFloat()) { | 172 | if (t->doesFloat()) { |
171 | mItem->setText(8,"---"); | 173 | mItem->setText(8,"---"); |
172 | } else { | 174 | } else { |
173 | mItem->setText(8,t->dtDueTimeStr()); | 175 | mItem->setText(8,t->dtDueTimeStr()); |
@@ -877,12 +879,13 @@ void KOListView::showDates(const QDate &start, const QDate &end) | |||
877 | updateView(); | 879 | updateView(); |
878 | 880 | ||
879 | } | 881 | } |
880 | 882 | ||
881 | void KOListView::addEvents(QPtrList<Event> eventList) | 883 | void KOListView::addEvents(QPtrList<Event> eventList) |
882 | { | 884 | { |
885 | |||
883 | Event *ev; | 886 | Event *ev; |
884 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 887 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
885 | addIncidence(ev); | 888 | addIncidence(ev); |
886 | } | 889 | } |
887 | if ( !mListView->currentItem() ){ | 890 | if ( !mListView->currentItem() ){ |
888 | updateView(); | 891 | updateView(); |
@@ -913,18 +916,18 @@ void KOListView::addJournals(QPtrList<Journal> eventList) | |||
913 | void KOListView::addIncidence(Incidence *incidence) | 916 | void KOListView::addIncidence(Incidence *incidence) |
914 | { | 917 | { |
915 | if ( mUidDict.find( incidence->uid() ) ) return; | 918 | if ( mUidDict.find( incidence->uid() ) ) return; |
916 | 919 | ||
917 | // mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 920 | // mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
918 | mUidDict.insert( incidence->uid(), incidence ); | 921 | mUidDict.insert( incidence->uid(), incidence ); |
919 | |||
920 | KOListViewItem *item = new KOListViewItem( incidence, mListView ); | 922 | KOListViewItem *item = new KOListViewItem( incidence, mListView ); |
921 | ListItemVisitor v(item, mStartDate ); | 923 | ListItemVisitor v(item, mStartDate ); |
922 | if (incidence->accept(v)) return; | 924 | if (incidence->accept(v)) { |
925 | return; | ||
926 | } | ||
923 | else delete item; | 927 | else delete item; |
924 | //qDebug("delete item "); | ||
925 | } | 928 | } |
926 | 929 | ||
927 | void KOListView::showEvents(QPtrList<Event> eventList) | 930 | void KOListView::showEvents(QPtrList<Event> eventList) |
928 | { | 931 | { |
929 | clear(); | 932 | clear(); |
930 | 933 | ||
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index de65b53..007d1f3 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -220,20 +220,17 @@ void SearchDialog::doSearch() | |||
220 | i18n("Invalid search expression,\ncannot perform " | 220 | i18n("Invalid search expression,\ncannot perform " |
221 | "the search.\nPlease enter a search expression\n" | 221 | "the search.\nPlease enter a search expression\n" |
222 | "using the wildcard characters\n '*' and '?'" | 222 | "using the wildcard characters\n '*' and '?'" |
223 | "where needed.")); | 223 | "where needed.")); |
224 | return; | 224 | return; |
225 | } | 225 | } |
226 | |||
227 | search(re); | 226 | search(re); |
228 | |||
229 | listView->setStartDate( mStartDate->date() ); | 227 | listView->setStartDate( mStartDate->date() ); |
230 | listView->showEvents(mMatchedEvents); | 228 | listView->showEvents(mMatchedEvents); |
231 | listView->addTodos(mMatchedTodos); | 229 | listView->addTodos(mMatchedTodos); |
232 | listView->addJournals(mMatchedJournals); | 230 | listView->addJournals(mMatchedJournals); |
233 | |||
234 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { | 231 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { |
235 | setCaption(i18n("No items found. Use '*' and '?' where needed.")); | 232 | setCaption(i18n("No items found. Use '*' and '?' where needed.")); |
236 | } else { | 233 | } else { |
237 | QString mess; | 234 | QString mess; |
238 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); | 235 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); |
239 | setCaption( i18n("KO/Pi Find: ") + mess); | 236 | setCaption( i18n("KO/Pi Find: ") + mess); |
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index d8f15b5..6de1566 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp | |||
@@ -355,13 +355,13 @@ QString Alarm::offsetText() | |||
355 | int min = -offset()/60; | 355 | int min = -offset()/60; |
356 | int hours = min /60; | 356 | int hours = min /60; |
357 | min = min % 60; | 357 | min = min % 60; |
358 | int days = hours /24; | 358 | int days = hours /24; |
359 | hours = hours % 24; | 359 | hours = hours % 24; |
360 | QString message; | 360 | QString message; |
361 | qDebug("%d %d %d ", days, hours, min ); | 361 | //qDebug("%d %d %d ", days, hours, min ); |
362 | if ( days > 0 ) | 362 | if ( days > 0 ) |
363 | message += i18n("%1d").arg( days ); | 363 | message += i18n("%1d").arg( days ); |
364 | if ( hours > 0 ) { | 364 | if ( hours > 0 ) { |
365 | if ( !message.isEmpty() ) message += "/"; | 365 | if ( !message.isEmpty() ) message += "/"; |
366 | message += i18n("%1h").arg( hours ); | 366 | message += i18n("%1h").arg( hours ); |
367 | } | 367 | } |
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 8ae5b46..7d61b7f 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp | |||
@@ -280,13 +280,13 @@ void KIncidenceFormatter::setJournal(Journal* ) | |||
280 | 280 | ||
281 | } | 281 | } |
282 | 282 | ||
283 | void KIncidenceFormatter::formatCategories(Incidence *event) | 283 | void KIncidenceFormatter::formatCategories(Incidence *event) |
284 | { | 284 | { |
285 | if (!event->categoriesStr().isEmpty()) { | 285 | if (!event->categoriesStr().isEmpty()) { |
286 | addTag("p",i18n("<b>Categories: </b>")+event->categoriesStr() ); | 286 | addTag("p",i18n("<b>Categories: </b>")+event->categoriesStrWithSpace() ); |
287 | //mText.append(event->categoriesStr()); | 287 | //mText.append(event->categoriesStr()); |
288 | } | 288 | } |
289 | } | 289 | } |
290 | void KIncidenceFormatter::addTag(const QString & tag,const QString & text) | 290 | void KIncidenceFormatter::addTag(const QString & tag,const QString & text) |
291 | { | 291 | { |
292 | int number=text.contains("\n"); | 292 | int number=text.contains("\n"); |