summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Unidiff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 9c1f5f3..582b2ef 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -159,79 +159,77 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
159 if ( event->doesRecur() ) { 159 if ( event->doesRecur() ) {
160 if ( event->recursOn( mDate) ) { 160 if ( event->recursOn( mDate) ) {
161 prefix ="->" ;multiday = 1; 161 prefix ="->" ;multiday = 1;
162 } 162 }
163 else { 163 else {
164 int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); 164 int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
165 if ( event->recursOn( mDate.addDays( -days)) ) { 165 if ( event->recursOn( mDate.addDays( -days)) ) {
166 prefix ="<-" ;multiday = 3; 166 prefix ="<-" ;multiday = 3;
167 } 167 }
168 } 168 }
169 } else { 169 } else {
170 if (mDate == event->dtStart().date()) { 170 if (mDate == event->dtStart().date()) {
171 prefix ="->" ;multiday = 1; 171 prefix ="->" ;multiday = 1;
172 } else if (mDate == event->dtEnd().date()) { 172 } else if (mDate == event->dtEnd().date()) {
173 prefix ="<-" ;multiday = 3; 173 prefix ="<-" ;multiday = 3;
174 } 174 }
175 } 175 }
176 if ( !event->doesFloat() ) { 176 if ( !event->doesFloat() ) {
177 if ( mDate == event->dtStart().date () ) 177 if ( mDate == event->dtStart().date () )
178 time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; 178 time = KGlobal::locale()->formatTime(event->dtStart().time())+" ";
179 else if ( mDate == event->dtEnd().date () ) 179 else if ( mDate == event->dtEnd().date () )
180 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; 180 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
181 181
182 } 182 }
183 qDebug("event->isMultiDay() %s", event->summary().latin1() );
184 text = time + event->summary(); 183 text = time + event->summary();
185 mToolTipText += prefix + text; 184 mToolTipText += prefix + text;
186 } else { 185 } else {
187 if (event->doesFloat()) { 186 if (event->doesFloat()) {
188 text = event->summary(); 187 text = event->summary();
189 mToolTipText += text; 188 mToolTipText += text;
190 } 189 }
191 else { 190 else {
192 text = KGlobal::locale()->formatTime(event->dtStart().time()); 191 text = KGlobal::locale()->formatTime(event->dtStart().time());
193 text += " " + event->summary(); 192 text += " " + event->summary();
194 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 193 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
195 } 194 }
196 } 195 }
197 if ( !event->location().isEmpty() ) 196 if ( !event->location().isEmpty() )
198 mToolTipText += " (" + event->location() + ")"; 197 mToolTipText += " (" + event->location() + ")";
199#if QT_VERSION >= 0x030000 198#if QT_VERSION >= 0x030000
200 mToolTipText.replace( '<' , "&lt;" ); 199 mToolTipText.replace( '<' , "&lt;" );
201 mToolTipText.replace( '>' , "&gt;" ); 200 mToolTipText.replace( '>' , "&gt;" );
202#else 201#else
203 if ( mToolTipText.find ('<') > 0 ) { 202 if ( mToolTipText.find ('<') > 0 ) {
204 mToolTipText.replace( QRegExp("<") , "&lt;" ); 203 mToolTipText.replace( QRegExp("<") , "&lt;" );
205 } 204 }
206 if ( mToolTipText.find ('>') > 0 ) { 205 if ( mToolTipText.find ('>') > 0 ) {
207 mToolTipText.replace( QRegExp(">") , "&gt;" ); 206 mToolTipText.replace( QRegExp(">") , "&gt;" );
208 } 207 }
209#endif 208#endif
210 mToolTip.append( mToolTipText ); 209 mToolTip.append( mToolTipText );
211 } 210 }
212 mToolTip.sort(); 211 mToolTip.sort();
213 qDebug("%s ", mToolTip.join("<br>").latin1());
214 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); 212 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>");
215} 213}
216void KODayMatrix::setCalendar( Calendar *cal ) 214void KODayMatrix::setCalendar( Calendar *cal )
217{ 215{
218 mCalendar = cal; 216 mCalendar = cal;
219 217
220 setAcceptDrops( mCalendar ); 218 setAcceptDrops( mCalendar );
221 219
222 updateEvents(); 220 updateEvents();
223} 221}
224 222
225QColor KODayMatrix::getShadedColor(QColor color) 223QColor KODayMatrix::getShadedColor(QColor color)
226{ 224{
227 QColor shaded; 225 QColor shaded;
228 int h=0; 226 int h=0;
229 int s=0; 227 int s=0;
230 int v=0; 228 int v=0;
231 color.hsv(&h,&s,&v); 229 color.hsv(&h,&s,&v);
232 s = s/4; 230 s = s/4;
233 v = 192+v/4; 231 v = 192+v/4;
234 shaded.setHsv(h,s,v); 232 shaded.setHsv(h,s,v);
235 233
236 return shaded; 234 return shaded;
237} 235}