-rw-r--r-- | korganizer/kolistview.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 9a3ba73..bafd349 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -19,32 +19,33 @@ | |||
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 | 24 | ||
25 | #include <qlistview.h> | 25 | #include <qlistview.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | #include <qprogressbar.h> | 29 | #include <qprogressbar.h> |
30 | #include <qfileinfo.h> | 30 | #include <qfileinfo.h> |
31 | #include <qmessagebox.h> | 31 | #include <qmessagebox.h> |
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
34 | #include <qdir.h> | 34 | #include <qdir.h> |
35 | #include <qregexp.h> | ||
35 | 36 | ||
36 | #include <klocale.h> | 37 | #include <klocale.h> |
37 | #include <kdebug.h> | 38 | #include <kdebug.h> |
38 | #include <kiconloader.h> | 39 | #include <kiconloader.h> |
39 | #include <kglobal.h> | 40 | #include <kglobal.h> |
40 | 41 | ||
41 | #include <libkcal/calendar.h> | 42 | #include <libkcal/calendar.h> |
42 | #include <libkcal/calendarlocal.h> | 43 | #include <libkcal/calendarlocal.h> |
43 | #include <libkcal/icalformat.h> | 44 | #include <libkcal/icalformat.h> |
44 | #include <libkcal/vcalformat.h> | 45 | #include <libkcal/vcalformat.h> |
45 | #include <libkcal/recurrence.h> | 46 | #include <libkcal/recurrence.h> |
46 | #include <libkcal/filestorage.h> | 47 | #include <libkcal/filestorage.h> |
47 | #include <libkdepim/categoryselectdialog.h> | 48 | #include <libkdepim/categoryselectdialog.h> |
48 | #ifndef DESKTOP_VERSION | 49 | #ifndef DESKTOP_VERSION |
49 | #include <qpe/qpeapplication.h> | 50 | #include <qpe/qpeapplication.h> |
50 | #else | 51 | #else |
@@ -152,42 +153,47 @@ bool ListItemVisitor::visit(Todo *t) | |||
152 | d = t->dtDue().date(); | 153 | d = t->dtDue().date(); |
153 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 154 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
154 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 155 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
155 | mItem->setSortKey(7,key); | 156 | mItem->setSortKey(7,key); |
156 | } | 157 | } |
157 | if ( t->hasStartDate() ) { | 158 | if ( t->hasStartDate() ) { |
158 | d = t->dtStart().date(); | 159 | d = t->dtStart().date(); |
159 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 160 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
160 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 161 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
161 | mItem->setSortKey(1,key); | 162 | mItem->setSortKey(1,key); |
162 | } | 163 | } |
163 | return true; | 164 | return true; |
164 | } | 165 | } |
165 | 166 | ||
166 | bool ListItemVisitor::visit(Journal * j) | 167 | bool ListItemVisitor::visit(Journal * j) |
167 | { | 168 | { |
168 | mItem->setText(0,i18n("Journal")); | 169 | QString des = j->description().left(50); |
170 | des = des.simplifyWhiteSpace (); | ||
171 | des.replace (QRegExp ("\\n"),"" ); | ||
172 | des.replace (QRegExp ("\\r"),"" ); | ||
173 | mItem->setText(0,i18n("Journal")+": "+des.left(25)); | ||
169 | mItem->setText(1,j->dtStartDateStr()); | 174 | mItem->setText(1,j->dtStartDateStr()); |
170 | mItem->setText(2,"---"); | 175 | mItem->setText(2,"---"); |
171 | mItem->setText(3,"---"); | 176 | mItem->setText(3,"---"); |
172 | mItem->setText(4,"---"); | 177 | mItem->setText(4,"---"); |
173 | mItem->setText(5,"---"); | 178 | mItem->setText(5,"---"); |
174 | mItem->setText(6,"---"); | 179 | mItem->setText(6,"---"); |
175 | mItem->setText(7,j->dtStartDateStr()); | 180 | mItem->setText(7,j->dtStartDateStr()); |
176 | mItem->setText(8,"---"); | 181 | mItem->setText(8,"---"); |
177 | mItem->setText(9,"---"); | 182 | mItem->setText(9,"---"); |
183 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); | ||
178 | 184 | ||
179 | QString key; | 185 | QString key; |
180 | QDate d = j->dtStart().date(); | 186 | QDate d = j->dtStart().date(); |
181 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 187 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
182 | mItem->setSortKey(1,key); | 188 | mItem->setSortKey(1,key); |
183 | mItem->setSortKey(7,key); | 189 | mItem->setSortKey(7,key); |
184 | 190 | ||
185 | return true; | 191 | return true; |
186 | } | 192 | } |
187 | 193 | ||
188 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 194 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
189 | const char *name) | 195 | const char *name) |
190 | : KOEventView(calendar, parent, name) | 196 | : KOEventView(calendar, parent, name) |
191 | { | 197 | { |
192 | mActiveItem = 0; | 198 | mActiveItem = 0; |
193 | mListView = new KOListViewListView(this); | 199 | mListView = new KOListViewListView(this); |
@@ -676,37 +682,42 @@ void KOListView::updateConfig() | |||
676 | { | 682 | { |
677 | 683 | ||
678 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 684 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
679 | updateView(); | 685 | updateView(); |
680 | 686 | ||
681 | } | 687 | } |
682 | void KOListView::setStartDate(const QDate &start) | 688 | void KOListView::setStartDate(const QDate &start) |
683 | { | 689 | { |
684 | mStartDate = start; | 690 | mStartDate = start; |
685 | } | 691 | } |
686 | 692 | ||
687 | void KOListView::showDates(const QDate &start, const QDate &end) | 693 | void KOListView::showDates(const QDate &start, const QDate &end) |
688 | { | 694 | { |
689 | clear(); | 695 | clear(); |
690 | mStartDate = start; | 696 | mStartDate = start; |
691 | QDate date = start; | 697 | QDate date = start; |
698 | QPtrList<Journal> j_list; | ||
692 | while( date <= end ) { | 699 | while( date <= end ) { |
693 | addEvents(calendar()->events(date)); | 700 | addEvents(calendar()->events(date)); |
694 | addTodos(calendar()->todos(date)); | 701 | addTodos(calendar()->todos(date)); |
702 | Journal* jo = calendar()->journal(date); | ||
703 | if ( jo ) | ||
704 | j_list.append( jo ); | ||
695 | date = date.addDays( 1 ); | 705 | date = date.addDays( 1 ); |
696 | } | 706 | } |
707 | addJournals(j_list); | ||
697 | emit incidenceSelected( 0 ); | 708 | emit incidenceSelected( 0 ); |
698 | updateView(); | 709 | updateView(); |
699 | 710 | ||
700 | } | 711 | } |
701 | 712 | ||
702 | void KOListView::addEvents(QPtrList<Event> eventList) | 713 | void KOListView::addEvents(QPtrList<Event> eventList) |
703 | { | 714 | { |
704 | Event *ev; | 715 | Event *ev; |
705 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 716 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
706 | addIncidence(ev); | 717 | addIncidence(ev); |
707 | } | 718 | } |
708 | if ( !mListView->currentItem() ){ | 719 | if ( !mListView->currentItem() ){ |
709 | updateView(); | 720 | updateView(); |
710 | } | 721 | } |
711 | } | 722 | } |
712 | 723 | ||