summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
authorzautrix <zautrix>2005-07-03 08:42:34 (UTC)
committer zautrix <zautrix>2005-07-03 08:42:34 (UTC)
commit971bfd3cf502fbbafc96bef70e21beb545e450b5 (patch) (unidiff)
tree2d4b2d0d291c5a23bb39e3f448403acbe86cc071 /korganizer/calendarview.cpp
parent914c795a77d8bb28fc8c2155cfc9524f3effdde1 (diff)
downloadkdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.zip
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.gz
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.bz2
fixes
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a10e93c..72221fd 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -665,35 +665,41 @@ void CalendarView::setScrollBarStep(int val )
665{ 665{
666#ifdef DESKTOP_VERSION 666#ifdef DESKTOP_VERSION
667 mDateScrollBar->setLineStep ( val ); 667 mDateScrollBar->setLineStep ( val );
668#endif 668#endif
669} 669}
670void CalendarView::scrollBarValue(int val ) 670void CalendarView::scrollBarValue(int val )
671{ 671{
672#ifdef DESKTOP_VERSION 672#ifdef DESKTOP_VERSION
673 if ( QApplication::desktop()->width() < 800 ) return; 673 if ( QApplication::desktop()->width() < 800 ) return;
674 static bool block = false; 674 static bool block = false;
675 if ( block ) return; 675 if ( block ) return;
676 block = true; 676 block = true;
677 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
678 //qDebug("VAL %d ",val );
679 int count = mNavigator->selectedDates().count(); 677 int count = mNavigator->selectedDates().count();
680 int year = mNavigator->selectedDates().first().year();
681 int day = mNavigator->selectedDates().first().dayOfYear(); 678 int day = mNavigator->selectedDates().first().dayOfYear();
682 if ( val == day -1 ) { 679 int stepdays = val;
680 if ( mDateScrollBar->lineStep () <= count ) {
681 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
682 //qDebug("VAL %d ",val );
683 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
684 stepdays = day-1+stepdays;
685 if ( stepdays < 0 ) stepdays = 0;
686 }
687 if ( stepdays == day -1 ) {
683 block = false; 688 block = false;
684 return; 689 return;
685 } 690 }
691 int year = mNavigator->selectedDates().first().year();
686 QDate d ( year,1,1 ); 692 QDate d ( year,1,1 );
687 mNavigator->selectDates( d.addDays( val ), count ); 693 mNavigator->selectDates( d.addDays( stepdays) , count );
688 block = false; 694 block = false;
689#endif 695#endif
690 696
691} 697}
692void CalendarView::checkFiles() 698void CalendarView::checkFiles()
693{ 699{
694 QString message; 700 QString message;
695 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 701 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
696 KopiCalendarFile * cal = calendars.first(); 702 KopiCalendarFile * cal = calendars.first();
697 while ( cal ) { 703 while ( cal ) {
698 if ( cal->mErrorOnLoad ) { 704 if ( cal->mErrorOnLoad ) {
699 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 705 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";