summaryrefslogtreecommitdiffabout
path: root/microkde/kdatepickernew.cpp
Unidiff
Diffstat (limited to 'microkde/kdatepickernew.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdatepickernew.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/kdatepickernew.cpp b/microkde/kdatepickernew.cpp
index f60a422..8f8001e 100644
--- a/microkde/kdatepickernew.cpp
+++ b/microkde/kdatepickernew.cpp
@@ -300,33 +300,33 @@ KDatePicker::weekSelected(int week)
300 date = calendar->addDays(date, 1); 300 date = calendar->addDays(date, 1);
301 301
302 // date is now first day in week 1 some day in week 1 302 // date is now first day in week 1 some day in week 1
303 date = calendar->addDays(date, (week - calendar->weekNumber(date)) * 7); 303 date = calendar->addDays(date, (week - calendar->weekNumber(date)) * 7);
304 304
305 setDate(date); 305 setDate(date);
306} 306}
307 307
308void 308void
309KDatePicker::selectMonthClicked() 309KDatePicker::selectMonthClicked()
310{ 310{
311 // every year can have different month names (in some calendar systems) 311 // every year can have different month names (in some calendar systems)
312 const KCalendarSystem * calendar = KGlobal::locale()->calendar(); 312 const KCalendarSystem * calendar = KGlobal::locale()->calendar();
313 QDate date = table->getDate(); 313 QDate date = table->getDate();
314 int i, month, months = calendar->monthsInYear(date); 314 int i, month, months = calendar->monthsInYear(date);
315 315
316 QPopupMenu popup(selectMonth); 316 Q3PopupMenu popup(selectMonth);
317 317
318 for (i = 1; i <= months; i++) 318 for (i = 1; i <= months; i++)
319 popup.insertItem(calendar->monthName(i, calendar->year(date)), i); 319 popup.insertItem(calendar->monthName(i, calendar->year(date)), i);
320 320
321 popup.setActiveItem(calendar->month(date) - 1); 321 popup.setActiveItem(calendar->month(date) - 1);
322 322
323 if ( (month = popup.exec(selectMonth->mapToGlobal(QPoint(0, 0)), calendar->month(date) - 1)) == -1 ) return; // canceled 323 if ( (month = popup.exec(selectMonth->mapToGlobal(QPoint(0, 0)), calendar->month(date) - 1)) == -1 ) return; // canceled
324 324
325 int day = calendar->day(date); 325 int day = calendar->day(date);
326 // ----- construct a valid date in this month: 326 // ----- construct a valid date in this month:
327 //date.setYMD(date.year(), month, 1); 327 //date.setYMD(date.year(), month, 1);
328 //date.setYMD(date.year(), month, QMIN(day, date.daysInMonth())); 328 //date.setYMD(date.year(), month, QMIN(day, date.daysInMonth()));
329 calendar->setYMD(date, calendar->year(date), month, 329 calendar->setYMD(date, calendar->year(date), month,
330 QMIN(day, calendar->daysInMonth(date))); 330 QMIN(day, calendar->daysInMonth(date)));
331 // ----- set this month 331 // ----- set this month
332 setDate(date); 332 setDate(date);