summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
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
@@ -363,12 +363,17 @@ CalendarView::CalendarView( Calendar *calendar,
mTodoEditor = 0;
init();
}
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;
mBlockShowDates = false;
mConflictingEvent = 0;
mDatePickerMode = 0;
@@ -658,15 +663,14 @@ CalendarView::~CalendarView()
//kdDebug() << "~CalendarView() done" << endl;
}
void CalendarView::nextConflict( bool all, bool allday )
{
- static bool block = false;
- if ( block ) return;
- block = true;
+ if ( flag_blockConflict ) return;
+ flag_blockConflict = true;
QPtrList<Event> testlist = mCalendar->events();
Event * test = testlist.first();
while ( test ) {
test->setTagged( false );
test = testlist.next();
}
@@ -737,19 +741,19 @@ void CalendarView::nextConflict( bool all, bool allday )
if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
mViewManager->showDayView();
mNavigator->slotDaySelect( conflict.date() );
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;
}
void CalendarView::conflictAll()
{
nextConflict ( true, true );
@@ -777,33 +781,32 @@ void CalendarView::setScrollBarStep(int val )
#endif
}
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;
if ( mDateScrollBar->lineStep () <= count ) {
//val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
//qDebug("VAL %d ",val );
stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
stepdays = day+stepdays;
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
}
void CalendarView::updateView(const QDate &start, const QDate &end)
{
#ifdef DESKTOP_VERSION
@@ -836,15 +839,14 @@ void CalendarView::checkFiles()
cal = calendars.next();
}
if ( !message.isEmpty() ) {
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() ));
}
}
void CalendarView::checkAlarms()
{
KConfig *config = KOGlobals::config();
@@ -3013,21 +3015,20 @@ void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
// most of the changeEventDisplays() right now just call the view's
// total update mode, but they SHOULD be recoded to be more refresh-efficient.
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) {
// If there is an event view visible update the display
mViewManager->currentView()->changeEventDisplay(which,action);
// TODO: check, if update needed
@@ -3174,21 +3175,20 @@ void CalendarView::clearAllViews()
if ( kol )
kol->clearList();
}
}
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 )
mTodoList->updateView();
// We assume that the navigator only selects consecutive days.
updateView( tmpList.first(), tmpList.last() );