summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Unidiff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index b6061d0..9a3ba73 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -14,97 +14,96 @@
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 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 35
36#include <klocale.h> 36#include <klocale.h>
37#include <kdebug.h> 37#include <kdebug.h>
38#include <kiconloader.h> 38#include <kiconloader.h>
39#include <kglobal.h> 39#include <kglobal.h>
40 40
41#include <libkcal/calendar.h> 41#include <libkcal/calendar.h>
42#include <libkcal/calendarlocal.h> 42#include <libkcal/calendarlocal.h>
43#include <libkcal/icalformat.h> 43#include <libkcal/icalformat.h>
44#include <libkcal/vcalformat.h> 44#include <libkcal/vcalformat.h>
45#include <libkcal/recurrence.h> 45#include <libkcal/recurrence.h>
46#include <libkcal/filestorage.h> 46#include <libkcal/filestorage.h>
47#include <libkdepim/categoryselectdialog.h> 47#include <libkdepim/categoryselectdialog.h>
48#ifndef DESKTOP_VERSION 48#ifndef DESKTOP_VERSION
49#include <qpe/qpeapplication.h> 49#include <qpe/qpeapplication.h>
50#else 50#else
51#include <qapplication.h> 51#include <qapplication.h>
52#endif 52#endif
53 53
54#ifndef KORG_NOPRINTER 54#ifndef KORG_NOPRINTER
55#include "calprinter.h" 55#include "calprinter.h"
56#endif 56#endif
57#include "koglobals.h" 57#include "koglobals.h"
58#include "koprefs.h" 58#include "koprefs.h"
59#include "kfiledialog.h" 59#include "kfiledialog.h"
60 60
61#include "kolistview.h" 61#include "kolistview.h"
62#include "kolistview.moc"
63 62
64ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) 63ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
65{ 64{
66 mItem = item; 65 mItem = item;
67 mDate = date; 66 mDate = date;
68} 67}
69 68
70ListItemVisitor::~ListItemVisitor() 69ListItemVisitor::~ListItemVisitor()
71{ 70{
72} 71}
73 72
74bool ListItemVisitor::visit(Event *e) 73bool ListItemVisitor::visit(Event *e)
75{ 74{
76 75
77 bool ok = false; 76 bool ok = false;
78 QString start, end; 77 QString start, end;
79 if ( e->doesRecur() ) { 78 if ( e->doesRecur() ) {
80 QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); 79 QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
81 if ( ok ) { 80 if ( ok ) {
82 int days = e->dtStart().date().daysTo(e->dtEnd().date() ); 81 int days = e->dtStart().date().daysTo(e->dtEnd().date() );
83 start = KGlobal::locale()->formatDate(d,true); 82 start = KGlobal::locale()->formatDate(d,true);
84 end = KGlobal::locale()->formatDate(d.addDays( days),true); 83 end = KGlobal::locale()->formatDate(d.addDays( days),true);
85 } 84 }
86 85
87 } 86 }
88 if ( ! ok ) { 87 if ( ! ok ) {
89 start =e->dtStartDateStr(); 88 start =e->dtStartDateStr();
90 end = e->dtEndDateStr(); 89 end = e->dtEndDateStr();
91 } 90 }
92 mItem->setText(0,e->summary()); 91 mItem->setText(0,e->summary());
93 mItem->setText(1,start); 92 mItem->setText(1,start);
94 mItem->setText(2,e->dtStartTimeStr()); 93 mItem->setText(2,e->dtStartTimeStr());
95 mItem->setText(3,end); 94 mItem->setText(3,end);
96 mItem->setText(4,e->dtEndTimeStr()); 95 mItem->setText(4,e->dtEndTimeStr());
97 mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); 96 mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No"));
98 mItem->setText(6, e->recurrence()->recurrenceText()); 97 mItem->setText(6, e->recurrence()->recurrenceText());
99 mItem->setText(7,"---"); 98 mItem->setText(7,"---");
100 mItem->setText(8,"---"); 99 mItem->setText(8,"---");
101 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); 100 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No"));
102 mItem->setText(10,e->categoriesStr()); 101 mItem->setText(10,e->categoriesStr());
103 102
104 QString key; 103 QString key;
105 QDate d = e->dtStart().date(); 104 QDate d = e->dtStart().date();
106 QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); 105 QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
107 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute()); 106 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute());
108 mItem->setSortKey(1,key); 107 mItem->setSortKey(1,key);
109 108
110 d = e->dtEnd().date(); 109 d = e->dtEnd().date();