From 15b9123c6c1f9096a4b1a7729c323433d408c8d7 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 26 Oct 2005 09:10:50 +0000 Subject: fix --- (limited to 'korganizer/calendarview.cpp') 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, void CalendarView::init() { + flag_blockConflict = false; + flag_blockScrollBar = false; + flag_checkFileFirsttime = true; + flag_clearallviewsEventDisplay = false; + flag_clearallviewsupdateView = false; mNextAlarmDateTime = QDateTime::currentDateTime(); setFocusPolicy (NoFocus ); mViewerCallerIsSearchDialog = false; @@ -661,9 +666,8 @@ CalendarView::~CalendarView() void CalendarView::nextConflict( bool all, bool allday ) { - static bool block = false; - if ( block ) return; - block = true; + if ( flag_blockConflict ) return; + flag_blockConflict = true; QPtrList testlist = mCalendar->events(); Event * test = testlist.first(); while ( test ) { @@ -740,13 +744,13 @@ void CalendarView::nextConflict( bool all, bool allday ) int hour = conflict.time().hour(); mViewManager->agendaView()->setStartHour( hour ); topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); - block = false; + flag_blockConflict = false; return; } topLevelWidget()->setCaption( i18n("No conflict found") ); //qDebug("No conflict found "); - block = false; + flag_blockConflict = false; return; } @@ -780,9 +784,8 @@ void CalendarView::scrollBarValue(int val ) { #ifdef DESKTOP_VERSION if ( QApplication::desktop()->width() < 800 ) return; - static bool block = false; - if ( block ) return; - block = true; + if ( flag_blockScrollBar ) return; + flag_blockScrollBar = true; int count = mNavigator->selectedDates().count(); int day = mNavigator->selectedDates().first().dayOfYear(); int stepdays = val; @@ -794,13 +797,13 @@ void CalendarView::scrollBarValue(int val ) if ( stepdays < 0 ) stepdays = 0; } if ( stepdays == day ) { - block = false; + flag_blockScrollBar = false; return; } int year = mNavigator->selectedDates().first().year(); QDate d ( year,1,1 ); mNavigator->selectDates( d.addDays( stepdays-1) , count ); - block = false; + flag_blockScrollBar = false; #endif } @@ -839,9 +842,8 @@ void CalendarView::checkFiles() 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); KMessageBox::error(this,message, i18n("Loading of calendar(s) failed")); } - static bool firstTime = true; - if ( firstTime ) { - firstTime = false; + if ( flag_checkFileFirsttime ) { + flag_checkFileFirsttime = false; QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); } } @@ -3016,15 +3018,14 @@ void CalendarView::changeEventDisplay(Event *which, int action) { // kdDebug() << "CalendarView::changeEventDisplay" << endl; changeIncidenceDisplay((Incidence *)which, action); - static bool clearallviews = false; if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { - if ( clearallviews ) { + if ( flag_clearallviewsEventDisplay ) { clearAllViews(); - clearallviews = false; + flag_clearallviewsEventDisplay = false; } return; } - clearallviews = true; + flag_clearallviewsEventDisplay = true; mDateNavigator->updateView(); //mDialogManager->updateSearchDialog(); if (which) { @@ -3177,15 +3178,14 @@ void CalendarView::clearAllViews() } void CalendarView::updateView() { - static bool clearallviews = false; if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { - if ( clearallviews ) { + if ( flag_clearallviewsupdateView ) { clearAllViews(); - clearallviews = false; + flag_clearallviewsupdateView = false; } return; } - clearallviews = true; + flag_clearallviewsupdateView = true; DateList tmpList = mNavigator->selectedDates(); if ( KOPrefs::instance()->mHideNonStartedTodos ) -- cgit v0.9.0.2