author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/koagendaitem.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | korganizer/koagendaitem.cpp | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 407424d..0f9a38f 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -1,159 +1,169 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qhbox.h> | 22 | #include <q3hbox.h> |
23 | #include <qvbox.h> | 23 | #include <q3vbox.h> |
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qwhatsthis.h> | 25 | #include <q3whatsthis.h> |
26 | #include <qdragobject.h> | 26 | #include <q3dragobject.h> |
27 | #include <qdrawutil.h> | 27 | #include <qdrawutil.h> |
28 | #include <qpainter.h> | 28 | #include <qpainter.h> |
29 | #include <QDesktopWidget> | ||
30 | //Added by qt3to4: | ||
31 | #include <Q3PtrList> | ||
32 | #include <QPixmap> | ||
33 | #include <QDragEnterEvent> | ||
34 | #include <QDropEvent> | ||
35 | #include <QResizeEvent> | ||
36 | #include <QMouseEvent> | ||
37 | #include <QEvent> | ||
38 | #include <QPaintEvent> | ||
29 | 39 | ||
30 | #include <kiconloader.h> | 40 | #include <kiconloader.h> |
31 | #include <kdebug.h> | 41 | #include <kdebug.h> |
32 | #include <kglobal.h> | 42 | #include <kglobal.h> |
33 | #include <klocale.h> | 43 | #include <klocale.h> |
34 | #ifndef DESKTOP_VERSION | 44 | #ifndef DESKTOP_VERSION |
35 | #include <qpe/qpeapplication.h> | 45 | #include <qpe/qpeapplication.h> |
36 | #define AGENDA_ICON_SIZE 5 | 46 | #define AGENDA_ICON_SIZE 5 |
37 | #else | 47 | #else |
38 | #include <qapplication.h> | 48 | #include <qapplication.h> |
39 | #define AGENDA_ICON_SIZE 7 | 49 | #define AGENDA_ICON_SIZE 7 |
40 | #endif | 50 | #endif |
41 | #include <libkcal/icaldrag.h> | 51 | #include <libkcal/icaldrag.h> |
42 | #include <libkcal/vcaldrag.h> | 52 | #include <libkcal/vcaldrag.h> |
43 | #include <libkcal/kincidenceformatter.h> | 53 | #include <libkcal/kincidenceformatter.h> |
44 | extern int globalFlagBlockAgenda; | 54 | extern int globalFlagBlockAgenda; |
45 | extern int globalFlagBlockAgendaItemPaint; | 55 | extern int globalFlagBlockAgendaItemPaint; |
46 | extern int globalFlagBlockAgendaItemUpdate; | 56 | extern int globalFlagBlockAgendaItemUpdate; |
47 | 57 | ||
48 | #include "koprefs.h" | 58 | #include "koprefs.h" |
49 | 59 | ||
50 | #include "koagendaitem.h" | 60 | #include "koagendaitem.h" |
51 | //#include "koagendaitem.moc" | 61 | //#include "koagendaitem.moc" |
52 | 62 | ||
53 | 63 | ||
54 | //-------------------------------------------------------------------------- | 64 | //-------------------------------------------------------------------------- |
55 | 65 | ||
56 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; | 66 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; |
57 | 67 | ||
58 | //-------------------------------------------------------------------------- | 68 | //-------------------------------------------------------------------------- |
59 | 69 | ||
60 | class KOAgendaItemWhatsThis :public QWhatsThis | 70 | class KOAgendaItemWhatsThis :public Q3WhatsThis |
61 | { | 71 | { |
62 | public: | 72 | public: |
63 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; | 73 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : Q3WhatsThis( view ),_view (view) { }; |
64 | 74 | ||
65 | protected: | 75 | protected: |
66 | virtual QString text( const QPoint& ) | 76 | virtual QString text( const QPoint& ) |
67 | { | 77 | { |
68 | return _view->getWhatsThisText() ; | 78 | return _view->getWhatsThisText() ; |
69 | } | 79 | } |
70 | private: | 80 | private: |
71 | KOAgendaItem * _view; | 81 | KOAgendaItem * _view; |
72 | }; | 82 | }; |
73 | 83 | ||
74 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, | 84 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, |
75 | const char *name,WFlags) : | 85 | const char *name,Qt::WFlags) : |
76 | QWidget(parent, name), mIncidence(incidence), mDate(qd) | 86 | QWidget(parent, name), mIncidence(incidence), mDate(qd) |
77 | { | 87 | { |
78 | #ifndef DESKTOP_VERSION | 88 | #ifndef DESKTOP_VERSION |
79 | //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); | 89 | //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); |
80 | #endif | 90 | #endif |
81 | mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); | 91 | mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); |
82 | int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase | 92 | Qt::WindowFlags wflags = windowFlags() |Qt::WRepaintNoErase;// WResizeNoErase |
83 | setWFlags ( wflags); | 93 | setWindowFlags ( wflags); |
84 | mAllDay = allday; | 94 | mAllDay = allday; |
85 | init ( incidence, qd ); | 95 | init ( incidence, qd ); |
86 | //setMouseTracking(true); | 96 | //setMouseTracking(true); |
87 | //setAcceptDrops(true); | 97 | //setAcceptDrops(true); |
88 | xPaintCoord = -1; | 98 | xPaintCoord = -1; |
89 | yPaintCoord = -1; | 99 | yPaintCoord = -1; |
90 | } | 100 | } |
91 | QString KOAgendaItem::getWhatsThisText() | 101 | QString KOAgendaItem::getWhatsThisText() |
92 | { | 102 | { |
93 | if ( mIncidence ) | 103 | if ( mIncidence ) |
94 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence, | 104 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence, |
95 | KOPrefs::instance()->mWTshowDetails, | 105 | KOPrefs::instance()->mWTshowDetails, |
96 | KOPrefs::instance()->mWTshowCreated, | 106 | KOPrefs::instance()->mWTshowCreated, |
97 | KOPrefs::instance()->mWTshowChanged); | 107 | KOPrefs::instance()->mWTshowChanged); |
98 | return "KOAgendaItem::getWhatsThisText()::internal error"; | 108 | return "KOAgendaItem::getWhatsThisText()::internal error"; |
99 | } | 109 | } |
100 | 110 | ||
101 | void KOAgendaItem::initColor () | 111 | void KOAgendaItem::initColor () |
102 | { | 112 | { |
103 | if ( (mIncidence->typeID() == todoID ) && | 113 | if ( (mIncidence->typeID() == todoID ) && |
104 | ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && | 114 | ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && |
105 | ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { | 115 | ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { |
106 | if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) | 116 | if ( (static_cast<Todo*>(mIncidence))->dtDue() < (QDateTime)QDateTime::currentDateTime().date()) |
107 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; | 117 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; |
108 | else | 118 | else |
109 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; | 119 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; |
110 | } | 120 | } |
111 | else { | 121 | else { |
112 | QStringList categories = mIncidence->categories(); | 122 | QStringList categories = mIncidence->categories(); |
113 | QString cat = categories.first(); | 123 | QString cat = categories.first(); |
114 | if (cat.isEmpty()) { | 124 | if (cat.isEmpty()) { |
115 | if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) | 125 | if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) |
116 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; | 126 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; |
117 | else | 127 | else |
118 | mBackgroundColor =KOPrefs::instance()->defaultColor( mIncidence->calID() ); | 128 | mBackgroundColor =KOPrefs::instance()->defaultColor( mIncidence->calID() ); |
119 | } else { | 129 | } else { |
120 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); | 130 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); |
121 | if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) { | 131 | if ( (mIncidence->typeID() == todoID ) &&((static_cast<Todo*>(mIncidence))->isCompleted()) ) { |
122 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) | 132 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) |
123 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; | 133 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; |
124 | } | 134 | } |
125 | } | 135 | } |
126 | 136 | ||
127 | } | 137 | } |
128 | 138 | ||
129 | QColor BackgroundColor ( mBackgroundColor ); | 139 | QColor BackgroundColor ( mBackgroundColor ); |
130 | if ( mIncidence->calID() > 1 ) { | 140 | if ( mIncidence->calID() > 1 ) { |
131 | //BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); | 141 | //BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); |
132 | } | 142 | } |
133 | mColorGroup = QColorGroup( BackgroundColor.light(), | 143 | mColorGroup = QColorGroup( BackgroundColor.light(), |
134 | BackgroundColor.dark(),BackgroundColor.light(), | 144 | BackgroundColor.dark(),BackgroundColor.light(), |
135 | BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; | 145 | BackgroundColor.dark(),BackgroundColor, Qt::black, BackgroundColor) ; |
136 | setBackgroundColor( mBackgroundColor ); | 146 | setBackgroundColor( mBackgroundColor ); |
137 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); | 147 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); |
138 | } | 148 | } |
139 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | 149 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) |
140 | { | 150 | { |
141 | mIncidence = incidence; | 151 | mIncidence = incidence; |
142 | mDate = qd; | 152 | mDate = qd; |
143 | mFirstMultiItem = 0; | 153 | mFirstMultiItem = 0; |
144 | mNextMultiItem = 0; | 154 | mNextMultiItem = 0; |
145 | mLastMultiItem = 0; | 155 | mLastMultiItem = 0; |
146 | computeText(); | 156 | computeText(); |
147 | initColor(); | 157 | initColor(); |
148 | mConflictItems.clear(); | 158 | mConflictItems.clear(); |
149 | setCellXY(0,0,1); | 159 | setCellXY(0,0,1); |
150 | setCellXWidth(0); | 160 | setCellXWidth(0); |
151 | setSubCell(0); | 161 | setSubCell(0); |
152 | setSubCells(1); | 162 | setSubCells(1); |
153 | setMultiItem(0,0,0); | 163 | setMultiItem(0,0,0); |
154 | startMove(); | 164 | startMove(); |
155 | mSelected = true; | 165 | mSelected = true; |
156 | select(false); | 166 | select(false); |
157 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); | 167 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); |
158 | mFontPixelSize = fontinf.height();; | 168 | mFontPixelSize = fontinf.height();; |
159 | hide(); | 169 | hide(); |
@@ -207,98 +217,98 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) | |||
207 | 217 | ||
208 | if ( mIncidence->calID() > 1 ) { | 218 | if ( mIncidence->calID() > 1 ) { |
209 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, KOPrefs::instance()->defaultColor( mIncidence->calID() ) ); | 219 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, KOPrefs::instance()->defaultColor( mIncidence->calID() ) ); |
210 | p->drawRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x-1, yOff*( 1 +AGENDA_ICON_SIZE)+y-1, AGENDA_ICON_SIZE+2, AGENDA_ICON_SIZE+2 ); | 220 | p->drawRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x-1, yOff*( 1 +AGENDA_ICON_SIZE)+y-1, AGENDA_ICON_SIZE+2, AGENDA_ICON_SIZE+2 ); |
211 | if ( horLayout ){ | 221 | if ( horLayout ){ |
212 | ++xOff; | 222 | ++xOff; |
213 | ++x; | 223 | ++x; |
214 | } | 224 | } |
215 | else { | 225 | else { |
216 | ++yOff; | 226 | ++yOff; |
217 | ++y; | 227 | ++y; |
218 | } | 228 | } |
219 | } | 229 | } |
220 | if (mIncidence->cancelled() && height() < 20 ) { | 230 | if (mIncidence->cancelled() && height() < 20 ) { |
221 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; | 231 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; |
222 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; | 232 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; |
223 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); | 233 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); |
224 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); | 234 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); |
225 | if ( horLayout ) | 235 | if ( horLayout ) |
226 | ++xOff; | 236 | ++xOff; |
227 | else | 237 | else |
228 | ++yOff; | 238 | ++yOff; |
229 | } | 239 | } |
230 | if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { | 240 | if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { |
231 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); | 241 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::red ); |
232 | if ( horLayout ) | 242 | if ( horLayout ) |
233 | ++xOff; | 243 | ++xOff; |
234 | else | 244 | else |
235 | ++yOff; | 245 | ++yOff; |
236 | } | 246 | } |
237 | if (mIncidence->doesRecur()) { | 247 | if (mIncidence->doesRecur()) { |
238 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); | 248 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::blue ); |
239 | if ( horLayout ) | 249 | if ( horLayout ) |
240 | ++xOff; | 250 | ++xOff; |
241 | else | 251 | else |
242 | ++yOff; | 252 | ++yOff; |
243 | } | 253 | } |
244 | if (mIncidence->description().length() > 0) { | 254 | if (mIncidence->description().length() > 0) { |
245 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); | 255 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkGreen ); |
246 | if ( horLayout ) | 256 | if ( horLayout ) |
247 | ++xOff; | 257 | ++xOff; |
248 | else | 258 | else |
249 | ++yOff; | 259 | ++yOff; |
250 | } | 260 | } |
251 | if (mIncidence->isReadOnly()) { | 261 | if (mIncidence->isReadOnly()) { |
252 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); | 262 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::white ); |
253 | if ( horLayout ) | 263 | if ( horLayout ) |
254 | ++xOff; | 264 | ++xOff; |
255 | else | 265 | else |
256 | ++yOff; | 266 | ++yOff; |
257 | } | 267 | } |
258 | 268 | ||
259 | if (mIncidence->attendeeCount()>0) { | 269 | if (mIncidence->attendeeCount()>0) { |
260 | 270 | ||
261 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { | 271 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { |
262 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); | 272 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::black ); |
263 | if ( horLayout ) | 273 | if ( horLayout ) |
264 | ++xOff; | 274 | ++xOff; |
265 | else | 275 | else |
266 | ++yOff; | 276 | ++yOff; |
267 | } else { | 277 | } else { |
268 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 278 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
269 | if (me!=0) { | 279 | if (me!=0) { |
270 | 280 | ||
271 | 281 | ||
272 | } else { | 282 | } else { |
273 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); | 283 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::yellow ); |
274 | if ( horLayout ) | 284 | if ( horLayout ) |
275 | ++xOff; | 285 | ++xOff; |
276 | else | 286 | else |
277 | ++yOff; | 287 | ++yOff; |
278 | 288 | ||
279 | } | 289 | } |
280 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); | 290 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkYellow ); |
281 | if ( horLayout ) | 291 | if ( horLayout ) |
282 | ++xOff; | 292 | ++xOff; |
283 | else | 293 | else |
284 | ++yOff; | 294 | ++yOff; |
285 | 295 | ||
286 | } | 296 | } |
287 | 297 | ||
288 | } | 298 | } |
289 | return ( yOff || xOff ); | 299 | return ( yOff || xOff ); |
290 | } | 300 | } |
291 | 301 | ||
292 | 302 | ||
293 | void KOAgendaItem::select(bool selected) | 303 | void KOAgendaItem::select(bool selected) |
294 | { | 304 | { |
295 | //qDebug("select %d %d",firstMultiItem(), nextMultiItem() ); | 305 | //qDebug("select %d %d",firstMultiItem(), nextMultiItem() ); |
296 | if (mSelected == selected) return; | 306 | if (mSelected == selected) return; |
297 | mSelected = selected; | 307 | mSelected = selected; |
298 | if ( ! isVisible() ) | 308 | if ( ! isVisible() ) |
299 | return; | 309 | return; |
300 | if ( firstMultiItem() ) | 310 | if ( firstMultiItem() ) |
301 | firstMultiItem()->select( selected ); | 311 | firstMultiItem()->select( selected ); |
302 | if ( !firstMultiItem() && nextMultiItem() ) { | 312 | if ( !firstMultiItem() && nextMultiItem() ) { |
303 | KOAgendaItem * placeItem = nextMultiItem(); | 313 | KOAgendaItem * placeItem = nextMultiItem(); |
304 | while ( placeItem ) { | 314 | while ( placeItem ) { |
@@ -399,75 +409,75 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | |||
399 | 409 | ||
400 | } | 410 | } |
401 | } | 411 | } |
402 | bool addIcon = false; | 412 | bool addIcon = false; |
403 | if ( ! small || w > 3 * h || h > 3* w ) | 413 | if ( ! small || w > 3 * h || h > 3* w ) |
404 | addIcon = updateIcons( paint, horLayout ); | 414 | addIcon = updateIcons( paint, horLayout ); |
405 | 415 | ||
406 | //qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); | 416 | //qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); |
407 | qDrawWinPanel (paint, x, yy, w, h, mColorGroup, selected ,0); | 417 | qDrawWinPanel (paint, x, yy, w, h, mColorGroup, selected ,0); |
408 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); | 418 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); |
409 | if ( ! small ) { | 419 | if ( ! small ) { |
410 | x += 3; yy += 3;w -= 6; h-= 5; | 420 | x += 3; yy += 3;w -= 6; h-= 5; |
411 | } else { | 421 | } else { |
412 | x += 2; yy += 1;w -= 4; h-= 4; | 422 | x += 2; yy += 1;w -= 4; h-= 4; |
413 | if ( nfh < 6.01 ) { | 423 | if ( nfh < 6.01 ) { |
414 | yy -= 2; | 424 | yy -= 2; |
415 | h += 4; | 425 | h += 4; |
416 | } | 426 | } |
417 | else | 427 | else |
418 | if ( nfh < h -2 ) | 428 | if ( nfh < h -2 ) |
419 | ++yy; | 429 | ++yy; |
420 | } | 430 | } |
421 | int align; | 431 | int align; |
422 | #ifndef DESKTOP_VERSION | 432 | #ifndef DESKTOP_VERSION |
423 | align = ( AlignLeft|WordBreak|AlignTop); | 433 | align = ( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop); |
424 | #else | 434 | #else |
425 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 435 | align = ( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); |
426 | #endif | 436 | #endif |
427 | if ( addIcon ) { | 437 | if ( addIcon ) { |
428 | if ( ! horLayout ) { | 438 | if ( ! horLayout ) { |
429 | x += AGENDA_ICON_SIZE+3; | 439 | x += AGENDA_ICON_SIZE+3; |
430 | w -= (AGENDA_ICON_SIZE+3); | 440 | w -= (AGENDA_ICON_SIZE+3); |
431 | } | 441 | } |
432 | else { | 442 | else { |
433 | yy+= AGENDA_ICON_SIZE+2; | 443 | yy+= AGENDA_ICON_SIZE+2; |
434 | h -=(AGENDA_ICON_SIZE+3); | 444 | h -=(AGENDA_ICON_SIZE+3); |
435 | } | 445 | } |
436 | } | 446 | } |
437 | if ( mWhiteText ) | 447 | if ( mWhiteText ) |
438 | paint->setPen ( white); | 448 | paint->setPen ( Qt::white); |
439 | if ( x < 0 ) { | 449 | if ( x < 0 ) { |
440 | w = w+x-3; | 450 | w = w+x-3; |
441 | x = 3; | 451 | x = 3; |
442 | if ( !horLayout && addIcon ) | 452 | if ( !horLayout && addIcon ) |
443 | x += AGENDA_ICON_SIZE+3; | 453 | x += AGENDA_ICON_SIZE+3; |
444 | if ( w > parentWidget()->width() ){ | 454 | if ( w > parentWidget()->width() ){ |
445 | w = parentWidget()->width() - 6; | 455 | w = parentWidget()->width() - 6; |
446 | #ifndef DESKTOP_VERSION | 456 | #ifndef DESKTOP_VERSION |
447 | align = ( AlignHCenter|WordBreak|AlignTop); | 457 | align = ( Qt::AlignHCenter|Qt::TextWordWrap|Qt::AlignTop); |
448 | #else | 458 | #else |
449 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); | 459 | align = ( Qt::AlignHCenter|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); |
450 | #endif | 460 | #endif |
451 | 461 | ||
452 | } | 462 | } |
453 | } | 463 | } |
454 | QRect dr; | 464 | QRect dr; |
455 | if ( w + x > parentWidget()->width() ) | 465 | if ( w + x > parentWidget()->width() ) |
456 | w = parentWidget()->width()-x; | 466 | w = parentWidget()->width()-x; |
457 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); | 467 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); |
458 | //qDebug("%d %d %d %d ", x, yy, w, h ); | 468 | //qDebug("%d %d %d %d ", x, yy, w, h ); |
459 | if ( mIncidence->cancelled() ){ | 469 | if ( mIncidence->cancelled() ){ |
460 | 470 | ||
461 | 471 | ||
462 | small = ( height() < 20 ); | 472 | small = ( height() < 20 ); |
463 | 473 | ||
464 | if ( ! small ) { | 474 | if ( ! small ) { |
465 | QFontMetrics fm ( paint->font() ); | 475 | QFontMetrics fm ( paint->font() ); |
466 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); | 476 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); |
467 | } | 477 | } |
468 | 478 | ||
469 | } | 479 | } |
470 | pa.end(); | 480 | pa.end(); |
471 | 481 | ||
472 | } | 482 | } |
473 | 483 | ||
@@ -540,49 +550,49 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) | |||
540 | if ( mAllDay ) | 550 | if ( mAllDay ) |
541 | paintFrom = paintPixAllday(); | 551 | paintFrom = paintPixAllday(); |
542 | else | 552 | else |
543 | paintFrom = paintPix(); | 553 | paintFrom = paintPix(); |
544 | } | 554 | } |
545 | xx += rx; | 555 | xx += rx; |
546 | 556 | ||
547 | if ( xx < 0 ) { | 557 | if ( xx < 0 ) { |
548 | rw = rw + xx; | 558 | rw = rw + xx; |
549 | rx -= xx; | 559 | rx -= xx; |
550 | xx = 0; | 560 | xx = 0; |
551 | if ( rw <= 1 ) { | 561 | if ( rw <= 1 ) { |
552 | //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); | 562 | //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); |
553 | return; | 563 | return; |
554 | } | 564 | } |
555 | } | 565 | } |
556 | if ( paintFrom->width() < xx+rw ) { | 566 | if ( paintFrom->width() < xx+rw ) { |
557 | rw = paintFrom->width() - xx; | 567 | rw = paintFrom->width() - xx; |
558 | if ( rw <= 1 ) { | 568 | if ( rw <= 1 ) { |
559 | //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); | 569 | //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); |
560 | return; | 570 | return; |
561 | } | 571 | } |
562 | } | 572 | } |
563 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); | 573 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); |
564 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); | 574 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,QPainter::CompositionMode_Source); |
565 | } | 575 | } |
566 | void KOAgendaItem::computeText() | 576 | void KOAgendaItem::computeText() |
567 | { | 577 | { |
568 | mDisplayedText = mIncidence->summary(); | 578 | mDisplayedText = mIncidence->summary(); |
569 | if ( (mIncidence->typeID() == todoID ) ) { | 579 | if ( (mIncidence->typeID() == todoID ) ) { |
570 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { | 580 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { |
571 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) | 581 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) |
572 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; | 582 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; |
573 | else if ( !(mIncidence->doesFloat())) | 583 | else if ( !(mIncidence->doesFloat())) |
574 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; | 584 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; |
575 | } | 585 | } |
576 | } else { | 586 | } else { |
577 | if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) | 587 | if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) |
578 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; | 588 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; |
579 | 589 | ||
580 | if ( mAllDay ) { | 590 | if ( mAllDay ) { |
581 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { | 591 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { |
582 | int dur = 1+ (static_cast<Event*>(mIncidence))->dtStart().date().daysTo( (static_cast<Event*>(mIncidence))->dtEnd().date() ); | 592 | int dur = 1+ (static_cast<Event*>(mIncidence))->dtStart().date().daysTo( (static_cast<Event*>(mIncidence))->dtEnd().date() ); |
583 | mDisplayedText += " ("+QString::number( dur )+i18n(" days") +")" ; | 593 | mDisplayedText += " ("+QString::number( dur )+i18n(" days") +")" ; |
584 | 594 | ||
585 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { | 595 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { |
586 | if ( mIncidence->doesRecur() ) { | 596 | if ( mIncidence->doesRecur() ) { |
587 | mDisplayedText += " (" + mIncidence->recurrence()->recurrenceText() + ")"; | 597 | mDisplayedText += " (" + mIncidence->recurrence()->recurrenceText() + ")"; |
588 | } else { | 598 | } else { |
@@ -607,49 +617,49 @@ void KOAgendaItem::computeText() | |||
607 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); | 617 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); |
608 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); | 618 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); |
609 | } | 619 | } |
610 | else { | 620 | else { |
611 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); | 621 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); |
612 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); | 622 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); |
613 | } | 623 | } |
614 | } | 624 | } |
615 | else if ( mIncidence->typeID() == todoID ) { | 625 | else if ( mIncidence->typeID() == todoID ) { |
616 | if (mIncidence->hasStartDate()) | 626 | if (mIncidence->hasStartDate()) |
617 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr(); | 627 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr(); |
618 | if (((Todo*)mIncidence)->hasDueDate()) | 628 | if (((Todo*)mIncidence)->hasDueDate()) |
619 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); | 629 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); |
620 | } | 630 | } |
621 | } else if ( mIncidence->typeID() == todoID ) { | 631 | } else if ( mIncidence->typeID() == todoID ) { |
622 | if (mIncidence->hasStartDate()) | 632 | if (mIncidence->hasStartDate()) |
623 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); | 633 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); |
624 | if (((Todo*)mIncidence)->hasDueDate()) | 634 | if (((Todo*)mIncidence)->hasDueDate()) |
625 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); | 635 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); |
626 | } | 636 | } |
627 | 637 | ||
628 | if (!mIncidence->location().isEmpty()) { | 638 | if (!mIncidence->location().isEmpty()) { |
629 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); | 639 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); |
630 | } | 640 | } |
631 | QToolTip::add(this,tipText,toolTipGroup(),""); | 641 | QToolTip::add(this,tipText /*TODO:hacker: ,toolTipGroup(),"" */); |
632 | #endif | 642 | #endif |
633 | } | 643 | } |
634 | void KOAgendaItem::updateItem() | 644 | void KOAgendaItem::updateItem() |
635 | { | 645 | { |
636 | computeText(); | 646 | computeText(); |
637 | 647 | ||
638 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); | 648 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); |
639 | paintMe( mSelected ); | 649 | paintMe( mSelected ); |
640 | repaint( false); | 650 | repaint( false); |
641 | } | 651 | } |
642 | 652 | ||
643 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) | 653 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) |
644 | { | 654 | { |
645 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); | 655 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); |
646 | paintMe( mSelected ); | 656 | paintMe( mSelected ); |
647 | repaint( false ); | 657 | repaint( false ); |
648 | } | 658 | } |
649 | 659 | ||
650 | /* | 660 | /* |
651 | Return height of item in units of agenda cells | 661 | Return height of item in units of agenda cells |
652 | */ | 662 | */ |
653 | int KOAgendaItem::cellHeight() | 663 | int KOAgendaItem::cellHeight() |
654 | { | 664 | { |
655 | int ret = mCellYBottom - mCellYTop + 1; | 665 | int ret = mCellYBottom - mCellYTop + 1; |
@@ -774,92 +784,92 @@ void KOAgendaItem::expandBottom(int dy) | |||
774 | int newYTop = cellYTop(); | 784 | int newYTop = cellYTop(); |
775 | int newYBottom = cellYBottom() + dy; | 785 | int newYBottom = cellYBottom() + dy; |
776 | if (newYBottom < newYTop) newYBottom = newYTop; | 786 | if (newYBottom < newYTop) newYBottom = newYTop; |
777 | setCellY(newYTop, newYBottom); | 787 | setCellY(newYTop, newYBottom); |
778 | } | 788 | } |
779 | 789 | ||
780 | void KOAgendaItem::expandLeft(int dx) | 790 | void KOAgendaItem::expandLeft(int dx) |
781 | { | 791 | { |
782 | int newX = cellX() + dx; | 792 | int newX = cellX() + dx; |
783 | int newXWidth = cellXWidth(); | 793 | int newXWidth = cellXWidth(); |
784 | if (newX > newXWidth) newX = newXWidth; | 794 | if (newX > newXWidth) newX = newXWidth; |
785 | setCellX(newX,newXWidth); | 795 | setCellX(newX,newXWidth); |
786 | } | 796 | } |
787 | 797 | ||
788 | void KOAgendaItem::expandRight(int dx) | 798 | void KOAgendaItem::expandRight(int dx) |
789 | { | 799 | { |
790 | int newX = cellX(); | 800 | int newX = cellX(); |
791 | int newXWidth = cellXWidth() + dx; | 801 | int newXWidth = cellXWidth() + dx; |
792 | if (newXWidth < newX) newXWidth = newX; | 802 | if (newXWidth < newX) newXWidth = newX; |
793 | setCellX(newX,newXWidth); | 803 | setCellX(newX,newXWidth); |
794 | } | 804 | } |
795 | 805 | ||
796 | QToolTipGroup *KOAgendaItem::toolTipGroup() | 806 | QToolTipGroup *KOAgendaItem::toolTipGroup() |
797 | { | 807 | { |
798 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); | 808 | /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ |
799 | return mToolTipGroup; | 809 | return mToolTipGroup; |
800 | } | 810 | } |
801 | 811 | ||
802 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) | 812 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) |
803 | { | 813 | { |
804 | #ifndef KORG_NODND | 814 | #ifndef KORG_NODND |
805 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || | 815 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || |
806 | !QTextDrag::canDecode( e ) ) { | 816 | !Q3TextDrag::canDecode( e ) ) { |
807 | e->ignore(); | 817 | e->ignore(); |
808 | return; | 818 | return; |
809 | } | 819 | } |
810 | e->accept(); | 820 | e->accept(); |
811 | #endif | 821 | #endif |
812 | } | 822 | } |
813 | 823 | ||
814 | void KOAgendaItem::dropEvent( QDropEvent *e ) | 824 | void KOAgendaItem::dropEvent( QDropEvent *e ) |
815 | { | 825 | { |
816 | #ifndef KORG_NODND | 826 | #ifndef KORG_NODND |
817 | QString text; | 827 | QString text; |
818 | if(QTextDrag::decode(e,text)) | 828 | if(Q3TextDrag::decode(e,text)) |
819 | { | 829 | { |
820 | kdDebug() << "Dropped : " << text << endl; | 830 | kdDebug() << "Dropped : " << text << endl; |
821 | QStringList emails = QStringList::split(",",text); | 831 | QStringList emails = QStringList::split(",",text); |
822 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 832 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
823 | kdDebug() << " Email: " << (*it) << endl; | 833 | kdDebug() << " Email: " << (*it) << endl; |
824 | int pos = (*it).find("<"); | 834 | int pos = (*it).find("<"); |
825 | QString name = (*it).left(pos); | 835 | QString name = (*it).left(pos); |
826 | QString email = (*it).mid(pos); | 836 | QString email = (*it).mid(pos); |
827 | if (!email.isEmpty()) { | 837 | if (!email.isEmpty()) { |
828 | mIncidence->addAttendee(new Attendee(name,email)); | 838 | mIncidence->addAttendee(new Attendee(name,email)); |
829 | } | 839 | } |
830 | } | 840 | } |
831 | } | 841 | } |
832 | #endif | 842 | #endif |
833 | } | 843 | } |
834 | 844 | ||
835 | 845 | ||
836 | QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() | 846 | Q3PtrList<KOAgendaItem> KOAgendaItem::conflictItems() |
837 | { | 847 | { |
838 | return mConflictItems; | 848 | return mConflictItems; |
839 | } | 849 | } |
840 | 850 | ||
841 | void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) | 851 | void KOAgendaItem::setConflictItems(Q3PtrList<KOAgendaItem> ci) |
842 | { | 852 | { |
843 | mConflictItems = ci; | 853 | mConflictItems = ci; |
844 | KOAgendaItem *item; | 854 | KOAgendaItem *item; |
845 | for ( item=mConflictItems.first(); item != 0; | 855 | for ( item=mConflictItems.first(); item != 0; |
846 | item=mConflictItems.next() ) { | 856 | item=mConflictItems.next() ) { |
847 | item->addConflictItem(this); | 857 | item->addConflictItem(this); |
848 | } | 858 | } |
849 | } | 859 | } |
850 | 860 | ||
851 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) | 861 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) |
852 | { | 862 | { |
853 | if (mConflictItems.find(ci)<0) | 863 | if (mConflictItems.find(ci)<0) |
854 | mConflictItems.append(ci); | 864 | mConflictItems.append(ci); |
855 | } | 865 | } |
856 | 866 | ||
857 | bool KOAgendaItem::checkLayout() | 867 | bool KOAgendaItem::checkLayout() |
858 | { | 868 | { |
859 | if ( !mConflictItems.count() ) | 869 | if ( !mConflictItems.count() ) |
860 | return true; | 870 | return true; |
861 | int max = 0; | 871 | int max = 0; |
862 | KOAgendaItem *item; | 872 | KOAgendaItem *item; |
863 | for ( item=mConflictItems.first(); item != 0; | 873 | for ( item=mConflictItems.first(); item != 0; |
864 | item=mConflictItems.next() ) { | 874 | item=mConflictItems.next() ) { |
865 | if ( item->subCells() > max ) | 875 | if ( item->subCells() > max ) |