-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index edeebdf..27ba9e0 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -81,97 +81,97 @@ void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) | |||
81 | connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) ); | 81 | connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) ); |
82 | connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) ); | 82 | connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) ); |
83 | connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) ); | 83 | connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) ); |
84 | 84 | ||
85 | connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); | 85 | connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); |
86 | } | 86 | } |
87 | void DateNavigatorContainer::slotgoNextYear() | 87 | void DateNavigatorContainer::slotgoNextYear() |
88 | { | 88 | { |
89 | jumpMonth( 12 ); | 89 | jumpMonth( 12 ); |
90 | emit goNextYear(); | 90 | emit goNextYear(); |
91 | 91 | ||
92 | } | 92 | } |
93 | void DateNavigatorContainer::slotgoPrevYear() | 93 | void DateNavigatorContainer::slotgoPrevYear() |
94 | { | 94 | { |
95 | jumpMonth( -12 ); | 95 | jumpMonth( -12 ); |
96 | emit goPrevYear(); | 96 | emit goPrevYear(); |
97 | 97 | ||
98 | } | 98 | } |
99 | void DateNavigatorContainer::slotgoPrevMonth() | 99 | void DateNavigatorContainer::slotgoPrevMonth() |
100 | { | 100 | { |
101 | jumpMonth( -1 ); | 101 | jumpMonth( -1 ); |
102 | emit goPrevMonth(); | 102 | emit goPrevMonth(); |
103 | 103 | ||
104 | } | 104 | } |
105 | void DateNavigatorContainer::slotgoNextMonth() | 105 | void DateNavigatorContainer::slotgoNextMonth() |
106 | { | 106 | { |
107 | jumpMonth( 1 ); | 107 | jumpMonth( 1 ); |
108 | emit goNextMonth(); | 108 | emit goNextMonth(); |
109 | } | 109 | } |
110 | void DateNavigatorContainer::jumpMonth( int month ) | 110 | void DateNavigatorContainer::jumpMonth( int month ) |
111 | { | 111 | { |
112 | 112 | ||
113 | QDate baseDate = mNavigatorView->baseDate(); | 113 | QDate baseDate = mNavigatorView->baseDate(); |
114 | computeMonthSelected( baseDate.month() + month, false ); | 114 | computeMonthSelected( baseDate.month() + month, false ); |
115 | } | 115 | } |
116 | void DateNavigatorContainer::slotMonthSelected( int month ) | 116 | void DateNavigatorContainer::slotMonthSelected( int month ) |
117 | { | 117 | { |
118 | computeMonthSelected( month, true ); | 118 | computeMonthSelected( month, true ); |
119 | } | 119 | } |
120 | void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) | 120 | void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) |
121 | { | 121 | { |
122 | //qDebug("slotMonthSelected %d ", month); | 122 | //qDebug("slotMonthSelected %d ", month); |
123 | QDate baseDate = mNavigatorView->baseDate(); | 123 | QDate baseDate = mNavigatorView->baseDate(); |
124 | if ( baseDate.month() == month ) | 124 | if ( baseDate.month() == month ) |
125 | return; | 125 | return; |
126 | //qDebug("month %d %d ",baseDate.month(),month); | 126 | //qDebug("month %d %d ",baseDate.month(),month); |
127 | QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); | 127 | QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); |
128 | date = date.addDays( -(baseDate.month()-month ) *30 ); | 128 | date = date.addDays( -(baseDate.month()-month ) *30 ); |
129 | QDate newBase = QDate ( date.year(), date.month() , baseDate.day() ); | 129 | QDate newBase = QDate ( date.year(), date.month() ,1 ); |
130 | 130 | ||
131 | //qDebug("NEW BASE %s", newBase.toString().latin1()); | 131 | //qDebug("NEW BASE %s", newBase.toString().latin1()); |
132 | mNavigatorView->setBaseDate( newBase ); | 132 | mNavigatorView->setBaseDate( newBase ); |
133 | QDate last = lastAvailableDate(); | 133 | QDate last = lastAvailableDate(); |
134 | QDate first = firstAvailableDate(); | 134 | QDate first = firstAvailableDate(); |
135 | 135 | ||
136 | QDate selFirst = mFirstSelectedDate; | 136 | QDate selFirst = mFirstSelectedDate; |
137 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); | 137 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); |
138 | if ( selFirst >= first && selLast <= last ) { | 138 | if ( selFirst >= first && selLast <= last ) { |
139 | setBaseDates(); | 139 | setBaseDates(); |
140 | if ( forceEmit ) | 140 | if ( forceEmit ) |
141 | updateDayMatrixDates(); | 141 | updateDayMatrixDates(); |
142 | } | 142 | } |
143 | else { | 143 | else { |
144 | setBaseDates(); | 144 | setBaseDates(); |
145 | if ( forceEmit ) | 145 | if ( forceEmit ) |
146 | updateDayMatrixDates(); | 146 | updateDayMatrixDates(); |
147 | if ( forceEmit ) | 147 | if ( forceEmit ) |
148 | emit monthSelected( month ); | 148 | emit monthSelected( month ); |
149 | } | 149 | } |
150 | } | 150 | } |
151 | void DateNavigatorContainer::setCalendar( Calendar *cal ) | 151 | void DateNavigatorContainer::setCalendar( Calendar *cal ) |
152 | { | 152 | { |
153 | mCalendar = cal; | 153 | mCalendar = cal; |
154 | mNavigatorView->setCalendar( cal ); | 154 | mNavigatorView->setCalendar( cal ); |
155 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 155 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
156 | KDateNavigator *n = mExtraViews.at( i ); | 156 | KDateNavigator *n = mExtraViews.at( i ); |
157 | n->setCalendar( cal ); | 157 | n->setCalendar( cal ); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | void DateNavigatorContainer::checkUpdateDayMatrixDates() | 160 | void DateNavigatorContainer::checkUpdateDayMatrixDates() |
161 | { | 161 | { |
162 | //qDebug("KODNC: wid %d hei %d ", width(), height()); | 162 | //qDebug("KODNC: wid %d hei %d ", width(), height()); |
163 | mUpdateTimer->stop(); | 163 | mUpdateTimer->stop(); |
164 | //return; | 164 | //return; |
165 | if ( width() < 3 || height() < 3 ) | 165 | if ( width() < 3 || height() < 3 ) |
166 | return; | 166 | return; |
167 | static int lastWid = 0; | 167 | static int lastWid = 0; |
168 | static int lastHei = 0; | 168 | static int lastHei = 0; |
169 | if ( lastWid == width() && height() == lastHei ) { | 169 | if ( lastWid == width() && height() == lastHei ) { |
170 | qDebug("KODNC: No layout computing needed. "); | 170 | qDebug("KODNC: No layout computing needed. "); |
171 | } else { | 171 | } else { |
172 | lastWid = width(); | 172 | lastWid = width(); |
173 | lastHei = height(); | 173 | lastHei = height(); |
174 | 174 | ||
175 | QSize minSize = mNavigatorView->yourSizeHint(); | 175 | QSize minSize = mNavigatorView->yourSizeHint(); |
176 | 176 | ||
177 | int verticalCount = size().height() / minSize.height(); | 177 | int verticalCount = size().height() / minSize.height(); |