summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 0523954..a23a3b2 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -147,86 +147,90 @@ void KOJournalView::newJournal()
147{ 147{
148 //qDebug(" KOJournalView::newJournal()"); 148 //qDebug(" KOJournalView::newJournal()");
149 flushView(); 149 flushView();
150 Journal* mJournal = new Journal; 150 Journal* mJournal = new Journal;
151 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); 151 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
152 mCalendar->addJournal(mJournal); 152 mCalendar->addJournal(mJournal);
153 showDates( mDate, QDate() ); 153 showDates( mDate, QDate() );
154} 154}
155 155
156void KOJournalView::showOnly ( Journal* j ) 156void KOJournalView::showOnly ( Journal* j )
157{ 157{
158 //qDebug("showOnly %x ", j); 158 //qDebug("showOnly %x ", j);
159 flushView(); 159 flushView();
160 if ( j == 0 ) { 160 if ( j == 0 ) {
161 showDates( mDate, QDate() ); 161 showDates( mDate, QDate() );
162 return; 162 return;
163 } 163 }
164 QPtrList<Journal> jl; 164 QPtrList<Journal> jl;
165 jl.append ( j ); 165 jl.append ( j );
166 showList( jl ); 166 showList( jl );
167 JournalEntry* mEntry = jEntries.first(); 167 JournalEntry* mEntry = jEntries.first();
168 mEntry->setShowOnly(); 168 mEntry->setShowOnly();
169} 169}
170void KOJournalView::showList(QPtrList<Journal> jl) 170void KOJournalView::showList(QPtrList<Journal> jl)
171{ 171{
172 static bool ff = false;
173 if ( ff ) return;
174 ff = true;
172 //qDebug("KOJournalView::showList %d",jl.count() ); 175 //qDebug("KOJournalView::showList %d",jl.count() );
173 JournalEntry* mEntry = jEntries.first(); 176 JournalEntry* mEntry = jEntries.first();
174 JournalEntry* firstEntry = mEntry; 177 JournalEntry* firstEntry = mEntry;
175 int count = jl.count(); 178 int count = jl.count();
176 int iii = 0; 179 int iii = 0;
177 while ( iii < count ) { 180 while ( iii < count ) {
178 if ( !mEntry ) { 181 if ( !mEntry ) {
179 mEntry = getNewEntry(); 182 mEntry = getNewEntry();
180 mEntry->setVisibleMode( true ); 183 mEntry->setVisibleMode( true );
181 mEntry->setDate(mDate); 184 mEntry->setDate(mDate);
182 mEntry->setJournal(jl.at(iii), false); 185 mEntry->setJournal(jl.at(iii), false);
183 mEntry->setVisibleMode( true ); 186 mEntry->setVisibleMode( true );
184 mEntry->show(); 187 mEntry->show();
185 mEntry = 0; 188 mEntry = 0;
186 } else { 189 } else {
187 mEntry->setVisibleMode( true ); 190 mEntry->setVisibleMode( true );
188 mEntry->setDate(mDate); 191 mEntry->setDate(mDate);
189 mEntry->setJournal(jl.at(iii), false); 192 mEntry->setJournal(jl.at(iii), false);
190 mEntry->setVisibleMode( true ); 193 mEntry->setVisibleMode( true );
191 mEntry->show(); 194 mEntry->show();
192 mEntry = jEntries.next(); 195 mEntry = jEntries.next();
193 } 196 }
194 ++iii; 197 ++iii;
195 } 198 }
196 while ( mEntry ) { 199 while ( mEntry ) {
197 mEntry->setDate(mDate); 200 mEntry->setDate(mDate);
198 mEntry->clear(); 201 mEntry->clear();
199 if ( mEntry != firstEntry ) { 202 if ( mEntry != firstEntry ) {
200 mEntry->hide(); 203 mEntry->hide();
201 mEntry->setVisibleMode( false ); 204 mEntry->setVisibleMode( false );
202 } 205 }
203 else { 206 else {
204 mEntry->setVisibleMode( true ); 207 mEntry->setVisibleMode( true );
205 mEntry->show(); 208 mEntry->show();
206 } 209 }
207 mEntry = jEntries.next(); 210 mEntry = jEntries.next();
208 } 211 }
212 ff = false;
209} 213}
210 214
211void KOJournalView::showDates(const QDate &start, const QDate &) 215void KOJournalView::showDates(const QDate &start, const QDate &)
212{ 216{
213 mDate = start; 217 mDate = start;
214 mDateLabel->setText(KGlobal::locale()->formatDate(mDate)); 218 mDateLabel->setText(KGlobal::locale()->formatDate(mDate));
215 QPtrList<Journal> jl = calendar()->journals4Date( start ); 219 QPtrList<Journal> jl = calendar()->journals4Date( start );
216 showList( jl ); 220 showList( jl );
217} 221}
218 222
219void KOJournalView::showEvents(QPtrList<Event>) 223void KOJournalView::showEvents(QPtrList<Event>)
220{ 224{
221 // After new creation of list view no events are selected. 225 // After new creation of list view no events are selected.
222// emit incidenceSelected( 0 ); 226// emit incidenceSelected( 0 );
223} 227}
224 228
225void KOJournalView::changeEventDisplay(Event *, int /*action*/) 229void KOJournalView::changeEventDisplay(Event *, int /*action*/)
226{ 230{
227 updateView(); 231 updateView();
228} 232}
229 233
230void KOJournalView::keyPressEvent ( QKeyEvent * e ) 234void KOJournalView::keyPressEvent ( QKeyEvent * e )
231{ 235{
232 //qDebug("keyPressEven "); 236 //qDebug("keyPressEven ");