summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Unidiff
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 90be237..b0f26d1 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -97,33 +97,36 @@ void KOViewManager::readSettings(KConfig *config)
97 showAgendaView(); 97 showAgendaView();
98 } 98 }
99} 99}
100 100
101void KOViewManager::showDateView( int view, QDate date) 101void KOViewManager::showDateView( int view, QDate date)
102{ 102{
103 static int lastMode = 0; 103 static int lastMode = 0;
104 static int lastCount = 0; 104 static int lastCount = 0;
105 static bool lastNDMode = false; 105 static bool lastNDMode = false;
106 static QDate lastDate; 106 static QDate lastDate;
107 //qDebug("date %d %s", view, date.toString().latin1()); 107 //qDebug("date %d %s", view, date.toString().latin1());
108 108
109 if (view != 9)
110 lastMode = 0;
109 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); 111 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
110 bool savemFlagShowNextxDays = mFlagShowNextxDays; 112 bool savemFlagShowNextxDays = mFlagShowNextxDays;
111 mFlagShowNextxDays = false; 113 mFlagShowNextxDays = false;
112 if ( view == 3 ) { 114 if ( view == 3 ) {
113 //mCurrentAgendaView = 1 ; 115 //mCurrentAgendaView = 1 ;
114 lastDate = mMainView->dateNavigator()->selectedDates().first(); 116 lastDate = mMainView->dateNavigator()->selectedDates().first();
115 lastCount = mMainView->dateNavigator()->selectedDates().count(); 117 lastCount = mMainView->dateNavigator()->selectedDates().count();
116 lastNDMode = savemFlagShowNextxDays; 118 lastNDMode = savemFlagShowNextxDays;
117 mMainView->showDay( date ); 119 mMainView->showDay( date );
120 lastMode = 1;
118 } else if (view == 4 ) { 121 } else if (view == 4 ) {
119 mCurrentAgendaView = 7 ; 122 mCurrentAgendaView = 7 ;
120 mMainView->dateNavigator()->selectDates( date, 7 ); 123 mMainView->dateNavigator()->selectDates( date, 7 );
121 } else if (view == 5 ) { 124 } else if (view == 5 ) {
122 mCurrentAgendaView = 14 ; 125 mCurrentAgendaView = 14 ;
123 mMainView->dateNavigator()->selectDates( date, 14); 126 mMainView->dateNavigator()->selectDates( date, 14);
124 } else if (view == 6 ) { 127 } else if (view == 6 ) {
125 //mMainView->dateNavigator()->selectDates( date, 7 ); 128 //mMainView->dateNavigator()->selectDates( date, 7 );
126 showMonthView(); 129 showMonthView();
127 } else if (view == 7 ) { 130 } else if (view == 7 ) {
128 mMainView->dateNavigator()->selectDate( date ); 131 mMainView->dateNavigator()->selectDate( date );
129 showJournalView(); 132 showJournalView();
@@ -141,25 +144,24 @@ void KOViewManager::showDateView( int view, QDate date)
141 if ( lastMode ) { 144 if ( lastMode ) {
142 mCurrentAgendaView = lastCount ; 145 mCurrentAgendaView = lastCount ;
143 mMainView->dateNavigator()->selectDates( lastDate, lastCount); 146 mMainView->dateNavigator()->selectDates( lastDate, lastCount);
144 mFlagShowNextxDays = lastNDMode; 147 mFlagShowNextxDays = lastNDMode;
145 if ( mFlagShowNextxDays ) { 148 if ( mFlagShowNextxDays ) {
146 mCurrentAgendaView = 3 ; 149 mCurrentAgendaView = 3 ;
147 } 150 }
148 } else 151 } else
149 showWeekView(); 152 showWeekView();
150 } else if (view == 10) { 153 } else if (view == 10) {
151 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); 154 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() );
152 } 155 }
153 lastMode = view;
154} 156}
155 157
156 158
157 159
158void KOViewManager::writeSettings(KConfig *config) 160void KOViewManager::writeSettings(KConfig *config)
159{ 161{
160 config->setGroup("General"); 162 config->setGroup("General");
161 163
162 QString view; 164 QString view;
163 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 165 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
164 else if (mCurrentView == mMonthView) view = "Month"; 166 else if (mCurrentView == mMonthView) view = "Month";
165 else if (mCurrentView == mListView) view = "List"; 167 else if (mCurrentView == mListView) view = "List";