author | zautrix <zautrix> | 2005-10-26 09:10:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-26 09:10:50 (UTC) |
commit | 15b9123c6c1f9096a4b1a7729c323433d408c8d7 (patch) (side-by-side diff) | |
tree | 3d9a8a521df355641642172ab1200a0f75529910 | |
parent | f696b904526567d45cd01a5b607644f8aa3bfe6b (diff) | |
download | kdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.zip kdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.tar.gz kdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.tar.bz2 |
fix
-rw-r--r-- | korganizer/calendarview.cpp | 42 | ||||
-rw-r--r-- | korganizer/calendarview.h | 5 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 8 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 4 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 16 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 7 |
8 files changed, 51 insertions, 33 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 28b17a5..31e103d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -367,4 +367,9 @@ 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 ); @@ -662,7 +667,6 @@ 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(); @@ -741,5 +745,5 @@ void CalendarView::nextConflict( bool all, bool allday ) 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; } @@ -747,5 +751,5 @@ void CalendarView::nextConflict( bool all, bool allday ) topLevelWidget()->setCaption( i18n("No conflict found") ); //qDebug("No conflict found "); - block = false; + flag_blockConflict = false; return; } @@ -781,7 +785,6 @@ 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(); @@ -795,5 +798,5 @@ void CalendarView::scrollBarValue(int val ) } if ( stepdays == day ) { - block = false; + flag_blockScrollBar = false; return; } @@ -801,5 +804,5 @@ void CalendarView::scrollBarValue(int val ) QDate d ( year,1,1 ); mNavigator->selectDates( d.addDays( stepdays-1) , count ); - block = false; + flag_blockScrollBar = false; #endif @@ -840,7 +843,6 @@ void CalendarView::checkFiles() 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() )); } @@ -3017,13 +3019,12 @@ 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(); @@ -3178,13 +3179,12 @@ 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(); diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 0924f07..80f7ed4 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -552,4 +552,9 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser QScrollBar * mDateScrollBar; #endif + bool flag_blockConflict; + bool flag_blockScrollBar; + bool flag_checkFileFirsttime; + bool flag_clearallviewsEventDisplay; + bool flag_clearallviewsupdateView; QDateTime mNextAlarmDateTime; bool mViewerCallerIsSearchDialog; diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index c1b149f..6e65a03 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -378,4 +378,5 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : KOEventView (cal,parent,name) { + flag_blockfillAgenda = false; mBlockUpdating = true; mStartHour = 8; @@ -1143,8 +1144,7 @@ void KOAgendaView::fillAgenda() if ( globalFlagBlockAgenda == 1 ) return; - static bool onlyOne = false; - if ( onlyOne ) + if ( flag_blockfillAgenda ) return; - onlyOne = true; + flag_blockfillAgenda = true; //if ( globalFlagBlockAgenda == 2 ) //globalFlagBlockAgenda = 0; @@ -1355,5 +1355,5 @@ void KOAgendaView::fillAgenda() repaintAgenda(); startIdleTimeout(); - onlyOne = false; + flag_blockfillAgenda = false; } void KOAgendaView::repaintAgenda() diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 4b7ef5b..5e68146 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -257,4 +257,5 @@ class KOAgendaView : public KOEventView { private: + bool flag_blockfillAgenda; QTimer* mIdleTimer; QDateTime mIdleStart; diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index a12c43e..d79a9b9 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -514,5 +514,5 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : KOrg::BaseView(calendar,parent,name) { - + mIsActiveWindow = false; mCurItem = 0; mCurItemRootParent = 0; @@ -951,4 +951,5 @@ void KOTodoView::storeCurrentItem() mCurItemParent = 0; mCurItemAbove = 0; + mIsActiveWindow = topLevelWidget()->isActiveWindow(); mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); if (mActiveItem) { @@ -1019,4 +1020,5 @@ void KOTodoView::resetCurrentItem() void KOTodoView::resetFocusToList() { + if ( mIsActiveWindow ) topLevelWidget()->setActiveWindow(); mTodoListView->setFocus(); diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index ecd0ad9..161ecb0 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -256,4 +256,5 @@ class KOTodoView : public KOrg::BaseView private: + bool mIsActiveWindow; void addQuickTodoPar( Todo * parentTodo); /* diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index ba3bc05..4057ae0 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -61,4 +61,11 @@ KOViewManager::KOViewManager( CalendarView *mainView ) : QObject(), mMainView( mainView ) { + + lastMode = 0; + lastCount = 0; + lastNDMode = false; + selecteddatescount = 0; + selecteddate = QDate ( 2000, 1, 1 ); + baseCycleDate = QDate ( 2000, 1, 1 ); mCurrentView = 0; flagResetViewChangeDate = 0; @@ -114,8 +121,5 @@ void KOViewManager::readSettings(KConfig *config) void KOViewManager::showDateView( int view, QDate date) { - static int lastMode = 0; - static int lastCount = 0; - static bool lastNDMode = false; - static QDate lastDate; + //qDebug("date %d %s", view, date.toString().latin1()); @@ -202,7 +206,5 @@ void KOViewManager::writeSettings(KConfig *config) void KOViewManager::showNextView() { - static int selecteddatescount = 0; - static QDate selecteddate = QDate ( 2000, 1, 1 ); - static QDate baseCycleDate = QDate ( 2000, 1, 1 ); + int newCount = mMainView->dateNavigator()->selectedDates().count(); if ( selecteddatescount != newCount && flagResetViewChangeDate == 0 ) { diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 2e6aaed..2aa46d0 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h @@ -105,4 +105,11 @@ class KOViewManager : public QObject private: + int lastMode; + int lastCount; + bool lastNDMode; + QDate lastDate; + int selecteddatescount; + QDate selecteddate; + QDate baseCycleDate; void resetDateSilent( QDate date , int days ); int flagResetViewChangeDate; |