summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-26 09:10:50 (UTC)
committer zautrix <zautrix>2005-10-26 09:10:50 (UTC)
commit15b9123c6c1f9096a4b1a7729c323433d408c8d7 (patch) (unidiff)
tree3d9a8a521df355641642172ab1200a0f75529910
parentf696b904526567d45cd01a5b607644f8aa3bfe6b (diff)
downloadkdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.zip
kdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.tar.gz
kdepimpi-15b9123c6c1f9096a4b1a7729c323433d408c8d7.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp42
-rw-r--r--korganizer/calendarview.h5
-rw-r--r--korganizer/koagendaview.cpp8
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/kotodoview.cpp6
-rw-r--r--korganizer/kotodoview.h1
-rw-r--r--korganizer/koviewmanager.cpp16
-rw-r--r--korganizer/koviewmanager.h7
8 files changed, 52 insertions, 34 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,
363 mTodoEditor = 0; 363 mTodoEditor = 0;
364 init(); 364 init();
365} 365}
366 366
367void CalendarView::init() 367void CalendarView::init()
368{ 368{
369 flag_blockConflict = false;
370 flag_blockScrollBar = false;
371 flag_checkFileFirsttime = true;
372 flag_clearallviewsEventDisplay = false;
373 flag_clearallviewsupdateView = false;
369 mNextAlarmDateTime = QDateTime::currentDateTime(); 374 mNextAlarmDateTime = QDateTime::currentDateTime();
370 setFocusPolicy (NoFocus ); 375 setFocusPolicy (NoFocus );
371 mViewerCallerIsSearchDialog = false; 376 mViewerCallerIsSearchDialog = false;
372 mBlockShowDates = false; 377 mBlockShowDates = false;
373 mConflictingEvent = 0; 378 mConflictingEvent = 0;
374 mDatePickerMode = 0; 379 mDatePickerMode = 0;
@@ -658,15 +663,14 @@ CalendarView::~CalendarView()
658 //kdDebug() << "~CalendarView() done" << endl; 663 //kdDebug() << "~CalendarView() done" << endl;
659} 664}
660 665
661 666
662void CalendarView::nextConflict( bool all, bool allday ) 667void CalendarView::nextConflict( bool all, bool allday )
663{ 668{
664 static bool block = false; 669 if ( flag_blockConflict ) return;
665 if ( block ) return; 670 flag_blockConflict = true;
666 block = true;
667 QPtrList<Event> testlist = mCalendar->events(); 671 QPtrList<Event> testlist = mCalendar->events();
668 Event * test = testlist.first(); 672 Event * test = testlist.first();
669 while ( test ) { 673 while ( test ) {
670 test->setTagged( false ); 674 test->setTagged( false );
671 test = testlist.next(); 675 test = testlist.next();
672 } 676 }
@@ -737,19 +741,19 @@ void CalendarView::nextConflict( bool all, bool allday )
737 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 741 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
738 mViewManager->showDayView(); 742 mViewManager->showDayView();
739 mNavigator->slotDaySelect( conflict.date() ); 743 mNavigator->slotDaySelect( conflict.date() );
740 int hour = conflict.time().hour(); 744 int hour = conflict.time().hour();
741 mViewManager->agendaView()->setStartHour( hour ); 745 mViewManager->agendaView()->setStartHour( hour );
742 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); 746 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) );
743 block = false; 747 flag_blockConflict = false;
744 return; 748 return;
745 } 749 }
746 750
747 topLevelWidget()->setCaption( i18n("No conflict found") ); 751 topLevelWidget()->setCaption( i18n("No conflict found") );
748 //qDebug("No conflict found "); 752 //qDebug("No conflict found ");
749 block = false; 753 flag_blockConflict = false;
750 return; 754 return;
751} 755}
752 756
753void CalendarView::conflictAll() 757void CalendarView::conflictAll()
754{ 758{
755 nextConflict ( true, true ); 759 nextConflict ( true, true );
@@ -777,33 +781,32 @@ void CalendarView::setScrollBarStep(int val )
777#endif 781#endif
778} 782}
779void CalendarView::scrollBarValue(int val ) 783void CalendarView::scrollBarValue(int val )
780{ 784{
781#ifdef DESKTOP_VERSION 785#ifdef DESKTOP_VERSION
782 if ( QApplication::desktop()->width() < 800 ) return; 786 if ( QApplication::desktop()->width() < 800 ) return;
783 static bool block = false; 787 if ( flag_blockScrollBar ) return;
784 if ( block ) return; 788 flag_blockScrollBar = true;
785 block = true;
786 int count = mNavigator->selectedDates().count(); 789 int count = mNavigator->selectedDates().count();
787 int day = mNavigator->selectedDates().first().dayOfYear(); 790 int day = mNavigator->selectedDates().first().dayOfYear();
788 int stepdays = val; 791 int stepdays = val;
789 if ( mDateScrollBar->lineStep () <= count ) { 792 if ( mDateScrollBar->lineStep () <= count ) {
790 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 793 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
791 //qDebug("VAL %d ",val ); 794 //qDebug("VAL %d ",val );
792 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 795 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
793 stepdays = day+stepdays; 796 stepdays = day+stepdays;
794 if ( stepdays < 0 ) stepdays = 0; 797 if ( stepdays < 0 ) stepdays = 0;
795 } 798 }
796 if ( stepdays == day ) { 799 if ( stepdays == day ) {
797 block = false; 800 flag_blockScrollBar = false;
798 return; 801 return;
799 } 802 }
800 int year = mNavigator->selectedDates().first().year(); 803 int year = mNavigator->selectedDates().first().year();
801 QDate d ( year,1,1 ); 804 QDate d ( year,1,1 );
802 mNavigator->selectDates( d.addDays( stepdays-1) , count ); 805 mNavigator->selectDates( d.addDays( stepdays-1) , count );
803 block = false; 806 flag_blockScrollBar = false;
804#endif 807#endif
805 808
806} 809}
807void CalendarView::updateView(const QDate &start, const QDate &end) 810void CalendarView::updateView(const QDate &start, const QDate &end)
808{ 811{
809#ifdef DESKTOP_VERSION 812#ifdef DESKTOP_VERSION
@@ -836,15 +839,14 @@ void CalendarView::checkFiles()
836 cal = calendars.next(); 839 cal = calendars.next();
837 } 840 }
838 if ( !message.isEmpty() ) { 841 if ( !message.isEmpty() ) {
839 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); 842 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);
840 KMessageBox::error(this,message, i18n("Loading of calendar(s) failed")); 843 KMessageBox::error(this,message, i18n("Loading of calendar(s) failed"));
841 } 844 }
842 static bool firstTime = true; 845 if ( flag_checkFileFirsttime ) {
843 if ( firstTime ) { 846 flag_checkFileFirsttime = false;
844 firstTime = false;
845 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 847 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
846 } 848 }
847} 849}
848void CalendarView::checkAlarms() 850void CalendarView::checkAlarms()
849{ 851{
850 KConfig *config = KOGlobals::config(); 852 KConfig *config = KOGlobals::config();
@@ -3013,21 +3015,20 @@ void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
3013// most of the changeEventDisplays() right now just call the view's 3015// most of the changeEventDisplays() right now just call the view's
3014// total update mode, but they SHOULD be recoded to be more refresh-efficient. 3016// total update mode, but they SHOULD be recoded to be more refresh-efficient.
3015void CalendarView::changeEventDisplay(Event *which, int action) 3017void CalendarView::changeEventDisplay(Event *which, int action)
3016{ 3018{
3017 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 3019 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
3018 changeIncidenceDisplay((Incidence *)which, action); 3020 changeIncidenceDisplay((Incidence *)which, action);
3019 static bool clearallviews = false;
3020 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3021 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3021 if ( clearallviews ) { 3022 if ( flag_clearallviewsEventDisplay ) {
3022 clearAllViews(); 3023 clearAllViews();
3023 clearallviews = false; 3024 flag_clearallviewsEventDisplay = false;
3024 } 3025 }
3025 return; 3026 return;
3026 } 3027 }
3027 clearallviews = true; 3028 flag_clearallviewsEventDisplay = true;
3028 mDateNavigator->updateView(); 3029 mDateNavigator->updateView();
3029 //mDialogManager->updateSearchDialog(); 3030 //mDialogManager->updateSearchDialog();
3030 if (which) { 3031 if (which) {
3031 // If there is an event view visible update the display 3032 // If there is an event view visible update the display
3032 mViewManager->currentView()->changeEventDisplay(which,action); 3033 mViewManager->currentView()->changeEventDisplay(which,action);
3033 // TODO: check, if update needed 3034 // TODO: check, if update needed
@@ -3174,21 +3175,20 @@ void CalendarView::clearAllViews()
3174 if ( kol ) 3175 if ( kol )
3175 kol->clearList(); 3176 kol->clearList();
3176 } 3177 }
3177} 3178}
3178void CalendarView::updateView() 3179void CalendarView::updateView()
3179{ 3180{
3180 static bool clearallviews = false;
3181 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3181 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3182 if ( clearallviews ) { 3182 if ( flag_clearallviewsupdateView ) {
3183 clearAllViews(); 3183 clearAllViews();
3184 clearallviews = false; 3184 flag_clearallviewsupdateView = false;
3185 } 3185 }
3186 return; 3186 return;
3187 } 3187 }
3188 clearallviews = true; 3188 flag_clearallviewsupdateView = true;
3189 DateList tmpList = mNavigator->selectedDates(); 3189 DateList tmpList = mNavigator->selectedDates();
3190 3190
3191 if ( KOPrefs::instance()->mHideNonStartedTodos ) 3191 if ( KOPrefs::instance()->mHideNonStartedTodos )
3192 mTodoList->updateView(); 3192 mTodoList->updateView();
3193 // We assume that the navigator only selects consecutive days. 3193 // We assume that the navigator only selects consecutive days.
3194 updateView( tmpList.first(), tmpList.last() ); 3194 updateView( tmpList.first(), tmpList.last() );
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 0924f07..80f7ed4 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -548,12 +548,17 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
548 void showTodoEditor(); 548 void showTodoEditor();
549 Todo *selectedTodo(); 549 Todo *selectedTodo();
550 private: 550 private:
551#ifdef DESKTOP_VERSION 551#ifdef DESKTOP_VERSION
552 QScrollBar * mDateScrollBar; 552 QScrollBar * mDateScrollBar;
553#endif 553#endif
554 bool flag_blockConflict;
555 bool flag_blockScrollBar;
556 bool flag_checkFileFirsttime;
557 bool flag_clearallviewsEventDisplay;
558 bool flag_clearallviewsupdateView;
554 QDateTime mNextAlarmDateTime; 559 QDateTime mNextAlarmDateTime;
555 bool mViewerCallerIsSearchDialog; 560 bool mViewerCallerIsSearchDialog;
556 bool mBlockShowDates; 561 bool mBlockShowDates;
557 KSyncManager* mSyncManager; 562 KSyncManager* mSyncManager;
558 AlarmDialog * mAlarmDialog; 563 AlarmDialog * mAlarmDialog;
559 QString mAlarmNotification; 564 QString mAlarmNotification;
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index c1b149f..6e65a03 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -374,12 +374,13 @@ void EventIndicator::enableColumn(int column, bool enable)
374//////////////////////////////////////////////////////////////////////////// 374////////////////////////////////////////////////////////////////////////////
375//////////////////////////////////////////////////////////////////////////// 375////////////////////////////////////////////////////////////////////////////
376 376
377KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : 377KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
378 KOEventView (cal,parent,name) 378 KOEventView (cal,parent,name)
379{ 379{
380 flag_blockfillAgenda = false;
380 mBlockUpdating = true; 381 mBlockUpdating = true;
381 mStartHour = 8; 382 mStartHour = 8;
382 mSelectedDates.append(QDate::currentDate()); 383 mSelectedDates.append(QDate::currentDate());
383 384
384 mLayoutDayLabels = 0; 385 mLayoutDayLabels = 0;
385 mDayLabelsFrame = 0; 386 mDayLabelsFrame = 0;
@@ -1139,16 +1140,15 @@ void KOAgendaView::fillAgenda(const QDate &)
1139void KOAgendaView::fillAgenda() 1140void KOAgendaView::fillAgenda()
1140{ 1141{
1141 if ( globalFlagBlockStartup ) 1142 if ( globalFlagBlockStartup )
1142 return; 1143 return;
1143 if ( globalFlagBlockAgenda == 1 ) 1144 if ( globalFlagBlockAgenda == 1 )
1144 return; 1145 return;
1145 static bool onlyOne = false; 1146 if ( flag_blockfillAgenda )
1146 if ( onlyOne )
1147 return; 1147 return;
1148 onlyOne = true; 1148 flag_blockfillAgenda = true;
1149 //if ( globalFlagBlockAgenda == 2 ) 1149 //if ( globalFlagBlockAgenda == 2 )
1150 //globalFlagBlockAgenda = 0; 1150 //globalFlagBlockAgenda = 0;
1151 // globalFlagBlockPainting = false; 1151 // globalFlagBlockPainting = false;
1152 if ( globalFlagBlockAgenda == 0 ) 1152 if ( globalFlagBlockAgenda == 0 )
1153 globalFlagBlockAgenda = 1; 1153 globalFlagBlockAgenda = 1;
1154 // clearView(); 1154 // clearView();
@@ -1351,13 +1351,13 @@ void KOAgendaView::fillAgenda()
1351 qApp->processEvents(); 1351 qApp->processEvents();
1352 globalFlagBlockAgenda = 0; 1352 globalFlagBlockAgenda = 0;
1353 mAllDayAgenda->drawContentsToPainter(); 1353 mAllDayAgenda->drawContentsToPainter();
1354 mAgenda->drawContentsToPainter(); 1354 mAgenda->drawContentsToPainter();
1355 repaintAgenda(); 1355 repaintAgenda();
1356 startIdleTimeout(); 1356 startIdleTimeout();
1357 onlyOne = false; 1357 flag_blockfillAgenda = false;
1358} 1358}
1359void KOAgendaView::repaintAgenda() 1359void KOAgendaView::repaintAgenda()
1360{ 1360{
1361 mAgenda->viewport()->repaint( false ); 1361 mAgenda->viewport()->repaint( false );
1362 mAllDayAgenda->viewport()->repaint( false ); 1362 mAllDayAgenda->viewport()->repaint( false );
1363 mAgenda->finishUpdate(); 1363 mAgenda->finishUpdate();
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 4b7ef5b..5e68146 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -253,12 +253,13 @@ class KOAgendaView : public KOEventView {
253 /** Updates data for selected timespan */ 253 /** Updates data for selected timespan */
254 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); 254 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd);
255 /** Updates data for selected timespan for all day event*/ 255 /** Updates data for selected timespan for all day event*/
256 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); 256 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd);
257 257
258 private: 258 private:
259 bool flag_blockfillAgenda;
259 QTimer* mIdleTimer; 260 QTimer* mIdleTimer;
260 QDateTime mIdleStart; 261 QDateTime mIdleStart;
261 // view widgets 262 // view widgets
262 QFrame *mDayLabels; 263 QFrame *mDayLabels;
263 QHBox *mDayLabelsFrame; 264 QHBox *mDayLabelsFrame;
264 QBoxLayout *mLayoutDayLabels; 265 QBoxLayout *mLayoutDayLabels;
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index a12c43e..d79a9b9 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -510,13 +510,13 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
510 510
511///////////////////////////////////////////////////////////////////////////// 511/////////////////////////////////////////////////////////////////////////////
512 512
513KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 513KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
514 KOrg::BaseView(calendar,parent,name) 514 KOrg::BaseView(calendar,parent,name)
515{ 515{
516 516 mIsActiveWindow = false;
517 mCurItem = 0; 517 mCurItem = 0;
518 mCurItemRootParent = 0; 518 mCurItemRootParent = 0;
519 mCurItemParent = 0; 519 mCurItemParent = 0;
520 mCurItemAbove = 0; 520 mCurItemAbove = 0;
521 mActiveItem = 0; 521 mActiveItem = 0;
522 mCategoryPopupMenu = 0; 522 mCategoryPopupMenu = 0;
@@ -947,12 +947,13 @@ void KOTodoView::updateView()
947void KOTodoView::storeCurrentItem() 947void KOTodoView::storeCurrentItem()
948{ 948{
949 mCurItem = 0; 949 mCurItem = 0;
950 mCurItemRootParent = 0; 950 mCurItemRootParent = 0;
951 mCurItemParent = 0; 951 mCurItemParent = 0;
952 mCurItemAbove = 0; 952 mCurItemAbove = 0;
953 mIsActiveWindow = topLevelWidget()->isActiveWindow();
953 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 954 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
954 if (mActiveItem) { 955 if (mActiveItem) {
955 mCurItem = mActiveItem->todo(); 956 mCurItem = mActiveItem->todo();
956 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove (); 957 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove ();
957 if ( activeItemAbove ) 958 if ( activeItemAbove )
958 mCurItemAbove = activeItemAbove->todo(); 959 mCurItemAbove = activeItemAbove->todo();
@@ -1015,13 +1016,14 @@ void KOTodoView::resetCurrentItem()
1015 processSelectionChange(); 1016 processSelectionChange();
1016 if ( mName != "todolistsmall" ) 1017 if ( mName != "todolistsmall" )
1017 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); 1018 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() ));
1018} 1019}
1019void KOTodoView::resetFocusToList() 1020void KOTodoView::resetFocusToList()
1020{ 1021{
1021 topLevelWidget()->setActiveWindow(); 1022 if ( mIsActiveWindow )
1023 topLevelWidget()->setActiveWindow();
1022 mTodoListView->setFocus(); 1024 mTodoListView->setFocus();
1023} 1025}
1024//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; 1026//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
1025bool KOTodoView::checkTodo( Todo * todo ) 1027bool KOTodoView::checkTodo( Todo * todo )
1026{ 1028{
1027 1029
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index ecd0ad9..161ecb0 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -252,12 +252,13 @@ class KOTodoView : public KOrg::BaseView
252 void processSelectionChange(); 252 void processSelectionChange();
253 void addQuickTodo(); 253 void addQuickTodo();
254 void setTodoModified( Todo* ); 254 void setTodoModified( Todo* );
255 void todoModified(Todo *, int ); 255 void todoModified(Todo *, int );
256 256
257 private: 257 private:
258 bool mIsActiveWindow;
258 void addQuickTodoPar( Todo * parentTodo); 259 void addQuickTodoPar( Todo * parentTodo);
259 /* 260 /*
260 * the TodoEditor approach is rather unscaling in the long 261 * the TodoEditor approach is rather unscaling in the long
261 * run. 262 * run.
262 * Korganizer keeps it in memory and we need to update 263 * Korganizer keeps it in memory and we need to update
263 * 1. make KOTodoViewItem a QObject again? 264 * 1. make KOTodoViewItem a QObject again?
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index ba3bc05..4057ae0 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -57,12 +57,19 @@ int 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;
@@ -110,16 +117,13 @@ void KOViewManager::readSettings(KConfig *config)
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;
@@ -198,15 +202,13 @@ void KOViewManager::writeSettings(KConfig *config)
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;
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 2e6aaed..2aa46d0 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -101,12 +101,19 @@ class KOViewManager : public QObject
101 void showMonthViewWeek(); 101 void showMonthViewWeek();
102 void showTodoView(); 102 void showTodoView();
103 void showJournalView(); 103 void showJournalView();
104 void showTimeSpanView(); 104 void showTimeSpanView();
105 105
106 private: 106 private:
107 int lastMode;
108 int lastCount;
109 bool lastNDMode;
110 QDate lastDate;
111 int selecteddatescount;
112 QDate selecteddate;
113 QDate baseCycleDate;
107 void resetDateSilent( QDate date , int days ); 114 void resetDateSilent( QDate date , int days );
108 int flagResetViewChangeDate; 115 int flagResetViewChangeDate;
109 QDate currentViewChangeDate; 116 QDate currentViewChangeDate;
110 void createMonthView(); 117 void createMonthView();
111 CalendarView *mMainView; 118 CalendarView *mMainView;
112 119