summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
authorzautrix <zautrix>2005-10-26 09:10:50 (UTC)
committer zautrix <zautrix>2005-10-26 09:10:50 (UTC)
commit15b9123c6c1f9096a4b1a7729c323433d408c8d7 (patch) (unidiff)
tree3d9a8a521df355641642172ab1200a0f75529910 /korganizer/calendarview.cpp
parentf696b904526567d45cd01a5b607644f8aa3bfe6b (diff)
downloadkdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.zip
kdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.tar.gz
kdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.tar.bz2
fix
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 28b17a5..31e103d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -366,6 +366,11 @@ CalendarView::CalendarView( Calendar *calendar,
366 366
367void CalendarView::init() 367void CalendarView::init()
368{ 368{
369 flag_blockConflict = false;
370 flag_blockScrollBar = false;
371 flag_checkFileFirsttime = true;
372 flag_clearallviewsEventDisplay = false;
373 flag_clearallviewsupdateView = false;
369 mNextAlarmDateTime = QDateTime::currentDateTime(); 374 mNextAlarmDateTime = QDateTime::currentDateTime();
370 setFocusPolicy (NoFocus ); 375 setFocusPolicy (NoFocus );
371 mViewerCallerIsSearchDialog = false; 376 mViewerCallerIsSearchDialog = false;
@@ -661,9 +666,8 @@ CalendarView::~CalendarView()
661 666
662void CalendarView::nextConflict( bool all, bool allday ) 667void CalendarView::nextConflict( bool all, bool allday )
663{ 668{
664 static bool block = false; 669 if ( flag_blockConflict ) return;
665 if ( block ) return; 670 flag_blockConflict = true;
666 block = true;
667 QPtrList<Event> testlist = mCalendar->events(); 671 QPtrList<Event> testlist = mCalendar->events();
668 Event * test = testlist.first(); 672 Event * test = testlist.first();
669 while ( test ) { 673 while ( test ) {
@@ -740,13 +744,13 @@ void CalendarView::nextConflict( bool all, bool allday )
740 int hour = conflict.time().hour(); 744 int hour = conflict.time().hour();
741 mViewManager->agendaView()->setStartHour( hour ); 745 mViewManager->agendaView()->setStartHour( hour );
742 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); 746 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) );
743 block = false; 747 flag_blockConflict = false;
744 return; 748 return;
745 } 749 }
746 750
747 topLevelWidget()->setCaption( i18n("No conflict found") ); 751 topLevelWidget()->setCaption( i18n("No conflict found") );
748 //qDebug("No conflict found "); 752 //qDebug("No conflict found ");
749 block = false; 753 flag_blockConflict = false;
750 return; 754 return;
751} 755}
752 756
@@ -780,9 +784,8 @@ void CalendarView::scrollBarValue(int val )
780{ 784{
781#ifdef DESKTOP_VERSION 785#ifdef DESKTOP_VERSION
782 if ( QApplication::desktop()->width() < 800 ) return; 786 if ( QApplication::desktop()->width() < 800 ) return;
783 static bool block = false; 787 if ( flag_blockScrollBar ) return;
784 if ( block ) return; 788 flag_blockScrollBar = true;
785 block = true;
786 int count = mNavigator->selectedDates().count(); 789 int count = mNavigator->selectedDates().count();
787 int day = mNavigator->selectedDates().first().dayOfYear(); 790 int day = mNavigator->selectedDates().first().dayOfYear();
788 int stepdays = val; 791 int stepdays = val;
@@ -794,13 +797,13 @@ void CalendarView::scrollBarValue(int val )
794 if ( stepdays < 0 ) stepdays = 0; 797 if ( stepdays < 0 ) stepdays = 0;
795 } 798 }
796 if ( stepdays == day ) { 799 if ( stepdays == day ) {
797 block = false; 800 flag_blockScrollBar = false;
798 return; 801 return;
799 } 802 }
800 int year = mNavigator->selectedDates().first().year(); 803 int year = mNavigator->selectedDates().first().year();
801 QDate d ( year,1,1 ); 804 QDate d ( year,1,1 );
802 mNavigator->selectDates( d.addDays( stepdays-1) , count ); 805 mNavigator->selectDates( d.addDays( stepdays-1) , count );
803 block = false; 806 flag_blockScrollBar = false;
804#endif 807#endif
805 808
806} 809}
@@ -839,9 +842,8 @@ void CalendarView::checkFiles()
839 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 842 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
840 KMessageBox::error(this,message, i18n("Loading of calendar(s) failed")); 843 KMessageBox::error(this,message, i18n("Loading of calendar(s) failed"));
841 } 844 }
842 static bool firstTime = true; 845 if ( flag_checkFileFirsttime ) {
843 if ( firstTime ) { 846 flag_checkFileFirsttime = false;
844 firstTime = false;
845 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 847 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
846 } 848 }
847} 849}
@@ -3016,15 +3018,14 @@ void CalendarView::changeEventDisplay(Event *which, int action)
3016{ 3018{
3017 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 3019 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
3018 changeIncidenceDisplay((Incidence *)which, action); 3020 changeIncidenceDisplay((Incidence *)which, action);
3019 static bool clearallviews = false;
3020 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3021 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3021 if ( clearallviews ) { 3022 if ( flag_clearallviewsEventDisplay ) {
3022 clearAllViews(); 3023 clearAllViews();
3023 clearallviews = false; 3024 flag_clearallviewsEventDisplay = false;
3024 } 3025 }
3025 return; 3026 return;
3026 } 3027 }
3027 clearallviews = true; 3028 flag_clearallviewsEventDisplay = true;
3028 mDateNavigator->updateView(); 3029 mDateNavigator->updateView();
3029 //mDialogManager->updateSearchDialog(); 3030 //mDialogManager->updateSearchDialog();
3030 if (which) { 3031 if (which) {
@@ -3177,15 +3178,14 @@ void CalendarView::clearAllViews()
3177} 3178}
3178void CalendarView::updateView() 3179void CalendarView::updateView()
3179{ 3180{
3180 static bool clearallviews = false;
3181 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3181 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3182 if ( clearallviews ) { 3182 if ( flag_clearallviewsupdateView ) {
3183 clearAllViews(); 3183 clearAllViews();
3184 clearallviews = false; 3184 flag_clearallviewsupdateView = false;
3185 } 3185 }
3186 return; 3186 return;
3187 } 3187 }
3188 clearallviews = true; 3188 flag_clearallviewsupdateView = true;
3189 DateList tmpList = mNavigator->selectedDates(); 3189 DateList tmpList = mNavigator->selectedDates();
3190 3190
3191 if ( KOPrefs::instance()->mHideNonStartedTodos ) 3191 if ( KOPrefs::instance()->mHideNonStartedTodos )