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 /microkde/kdatepickernew.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | microkde/kdatepickernew.cpp | 2 |
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 | ||
308 | void | 308 | void |
309 | KDatePicker::selectMonthClicked() | 309 | KDatePicker::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); |