summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show 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
@@ -365,8 +365,13 @@ 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;
mBlockShowDates = false;
@@ -660,11 +665,10 @@ 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<Event> testlist = mCalendar->events();
Event * test = testlist.first();
while ( test ) {
test->setTagged( false );
@@ -739,15 +743,15 @@ void CalendarView::nextConflict( bool all, bool allday )
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()
@@ -779,11 +783,10 @@ void CalendarView::setScrollBarStep(int val )
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 ) {
@@ -793,15 +796,15 @@ void CalendarView::scrollBarValue(int val )
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)
@@ -838,11 +841,10 @@ void CalendarView::checkFiles()
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()
@@ -3015,17 +3017,16 @@ void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
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
@@ -3176,17 +3177,16 @@ 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 )
mTodoList->updateView();