summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Unidiff
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index ba3bc05..4057ae0 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -55,16 +55,23 @@ int globalFlagBlockAgenda = 0;
55int globalFlagBlockLabel = 0; 55int globalFlagBlockLabel = 0;
56int globalFlagBlockAgendaItemPaint = 1; 56int globalFlagBlockAgendaItemPaint = 1;
57int globalFlagBlockAgendaItemUpdate = 1; 57int globalFlagBlockAgendaItemUpdate = 1;
58 58
59 59
60KOViewManager::KOViewManager( CalendarView *mainView ) : 60KOViewManager::KOViewManager( CalendarView *mainView ) :
61 QObject(), mMainView( mainView ) 61 QObject(), mMainView( mainView )
62{ 62{
63
64 lastMode = 0;
65 lastCount = 0;
66 lastNDMode = false;
67 selecteddatescount = 0;
68 selecteddate = QDate ( 2000, 1, 1 );
69 baseCycleDate = QDate ( 2000, 1, 1 );
63 mCurrentView = 0; 70 mCurrentView = 0;
64 flagResetViewChangeDate = 0; 71 flagResetViewChangeDate = 0;
65 mWhatsNextView = 0; 72 mWhatsNextView = 0;
66 mTodoView = 0; 73 mTodoView = 0;
67 mAgendaView = 0; 74 mAgendaView = 0;
68 mMonthView = 0; 75 mMonthView = 0;
69 mListView = 0; 76 mListView = 0;
70 mJournalView = 0; 77 mJournalView = 0;
@@ -108,20 +115,17 @@ void KOViewManager::readSettings(KConfig *config)
108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); 115 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) );
109#endif 116#endif
110 } 117 }
111} 118}
112 119
113 120
114void KOViewManager::showDateView( int view, QDate date) 121void KOViewManager::showDateView( int view, QDate date)
115{ 122{
116 static int lastMode = 0; 123
117 static int lastCount = 0;
118 static bool lastNDMode = false;
119 static QDate lastDate;
120 //qDebug("date %d %s", view, date.toString().latin1()); 124 //qDebug("date %d %s", view, date.toString().latin1());
121 125
122 if (view != 9) 126 if (view != 9)
123 lastMode = 0; 127 lastMode = 0;
124 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); 128 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
125 bool savemFlagShowNextxDays = mFlagShowNextxDays; 129 bool savemFlagShowNextxDays = mFlagShowNextxDays;
126 mFlagShowNextxDays = false; 130 mFlagShowNextxDays = false;
127 if ( view == 3 ) { 131 if ( view == 3 ) {
@@ -196,19 +200,17 @@ void KOViewManager::writeSettings(KConfig *config)
196 mListView->writeSettings(config); 200 mListView->writeSettings(config);
197 } 201 }
198 if (mTodoView) { 202 if (mTodoView) {
199 mTodoView->saveLayout(config,"Todo View"); 203 mTodoView->saveLayout(config,"Todo View");
200 } 204 }
201} 205}
202void KOViewManager::showNextView() 206void KOViewManager::showNextView()
203{ 207{
204 static int selecteddatescount = 0; 208
205 static QDate selecteddate = QDate ( 2000, 1, 1 );
206 static QDate baseCycleDate = QDate ( 2000, 1, 1 );
207 int newCount = mMainView->dateNavigator()->selectedDates().count(); 209 int newCount = mMainView->dateNavigator()->selectedDates().count();
208 if ( selecteddatescount != newCount && flagResetViewChangeDate == 0 ) { 210 if ( selecteddatescount != newCount && flagResetViewChangeDate == 0 ) {
209 flagResetViewChangeDate = 1; 211 flagResetViewChangeDate = 1;
210 } 212 }
211 if ( selecteddate != mMainView->dateNavigator()->selectedDates().first() ) 213 if ( selecteddate != mMainView->dateNavigator()->selectedDates().first() )
212 flagResetViewChangeDate = 1; 214 flagResetViewChangeDate = 1;
213 if ( flagResetViewChangeDate > 0 ) { 215 if ( flagResetViewChangeDate > 0 ) {
214 baseCycleDate = mMainView->dateNavigator()->selectedDates().first(); 216 baseCycleDate = mMainView->dateNavigator()->selectedDates().first();