author | zautrix <zautrix> | 2005-03-28 23:39:37 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-28 23:39:37 (UTC) |
commit | 4e7c45695672ecdbd0cd14cac0ea29a8e134ee78 (patch) (side-by-side diff) | |
tree | 6815e055d6cb35d56d43f036261f5be9d2a9c350 /korganizer/mainwindow.cpp | |
parent | 4034290f894ff7d1b0cf1197078e0ed832566bb7 (diff) | |
download | kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.zip kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.gz kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.bz2 |
montview sunday fix
-rw-r--r-- | korganizer/mainwindow.cpp | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 2da592b..8e52968 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1457,75 +1457,53 @@ void MainWindow::aboutKnownBugs() i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + i18n("\nor report them in the bugtracker on\n") + i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), QMessageBox::NoIcon, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); msg->exec(); delete msg; } QString MainWindow::defaultFileName() { return locateLocal( "data", "korganizer/mycalendar.ics" ); } QString MainWindow::syncFileName() { #ifdef DESKTOP_VERSION return locateLocal( "tmp", "synccalendar.ics" ); #else return QString( "/tmp/synccalendar.ics" ); #endif } +#include "koglobals.h" +#include <kcalendarsystem.h> void MainWindow::updateWeek(QDate seda) { - int weekNum = 0; - QDate d = QDate ( seda.year(), 1,1); - seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday - if ( seda.addDays(6).year() != seda.year() ) { - if ( seda.year() != d.year() ) { - if ( d.dayOfWeek() > 4 ) - d = QDate ( seda.year(), 1,1); - else - weekNum = 1; - } else { - QDate dd( seda.year()+1, 1,1); - if ( dd.dayOfWeek() <= 4 ) - weekNum = 1; - } - } - if ( weekNum == 0 ){ - int dow = d.dayOfWeek(); - if ( dow <= 4 ) - d = d.addDays( 1-dow ); - else // 5,6,7 - d = d.addDays( 8-dow ); - // we have the first week of the year.we are on monday - weekNum = d.daysTo( seda ) / 7 +1; - } - + int weekNum = KGlobal::locale()->weekNum ( seda ); mWeekPixmap.fill( mWeekBgColor ); QPainter p ( &mWeekPixmap ); p.setFont( mWeekFont ); p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); p.end(); QIconSet icon3 ( mWeekPixmap ); mWeekAction->setIconSet ( icon3 ); } void MainWindow::updateWeekNum(const DateList &selectedDates) { updateWeek( selectedDates.first() ); } void MainWindow::processIncidenceSelection( Incidence *incidence ) { if ( !incidence ) { enableIncidenceActions( false ); mNewSubTodoAction->setEnabled( false ); setCaptionToDates(); return; } |