summaryrefslogtreecommitdiffabout
path: root/korganizer/kojournalview.cpp
Unidiff
Diffstat (limited to 'korganizer/kojournalview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 9b0e748..0523954 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -134,78 +134,80 @@ void KOJournalView::flushView()
134 } 134 }
135 ff = false; 135 ff = false;
136} 136}
137 137
138void KOJournalView::clearList() 138void KOJournalView::clearList()
139{ 139{
140 JournalEntry* mEntry = jEntries.first(); 140 JournalEntry* mEntry = jEntries.first();
141 while ( mEntry ) { 141 while ( mEntry ) {
142 mEntry->clear(); 142 mEntry->clear();
143 mEntry = jEntries.next(); 143 mEntry = jEntries.next();
144 } 144 }
145} 145}
146void KOJournalView::newJournal() 146void 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 qDebug("KOJournalView::showList %d",jl.count() ); 172 //qDebug("KOJournalView::showList %d",jl.count() );
173 JournalEntry* mEntry = jEntries.first(); 173 JournalEntry* mEntry = jEntries.first();
174 JournalEntry* firstEntry = mEntry; 174 JournalEntry* firstEntry = mEntry;
175 int count = jl.count(); 175 int count = jl.count();
176 int iii = 0; 176 int iii = 0;
177 while ( iii < count ) { 177 while ( iii < count ) {
178 if ( !mEntry ) { 178 if ( !mEntry ) {
179 mEntry = getNewEntry(); 179 mEntry = getNewEntry();
180 mEntry->setVisibleMode( true );
180 mEntry->setDate(mDate); 181 mEntry->setDate(mDate);
181 mEntry->setJournal(jl.at(iii)); 182 mEntry->setJournal(jl.at(iii), false);
182 mEntry->setVisibleMode( true ); 183 mEntry->setVisibleMode( true );
183 mEntry->show(); 184 mEntry->show();
184 mEntry = 0; 185 mEntry = 0;
185 } else { 186 } else {
187 mEntry->setVisibleMode( true );
186 mEntry->setDate(mDate); 188 mEntry->setDate(mDate);
187 mEntry->setJournal(jl.at(iii)); 189 mEntry->setJournal(jl.at(iii), false);
188 mEntry->setVisibleMode( true ); 190 mEntry->setVisibleMode( true );
189 mEntry->show(); 191 mEntry->show();
190 mEntry = jEntries.next(); 192 mEntry = jEntries.next();
191 } 193 }
192 ++iii; 194 ++iii;
193 } 195 }
194 while ( mEntry ) { 196 while ( mEntry ) {
195 mEntry->setDate(mDate); 197 mEntry->setDate(mDate);
196 mEntry->clear(); 198 mEntry->clear();
197 if ( mEntry != firstEntry ) { 199 if ( mEntry != firstEntry ) {
198 mEntry->hide(); 200 mEntry->hide();
199 mEntry->setVisibleMode( false ); 201 mEntry->setVisibleMode( false );
200 } 202 }
201 else { 203 else {
202 mEntry->setVisibleMode( true ); 204 mEntry->setVisibleMode( true );
203 mEntry->show(); 205 mEntry->show();
204 } 206 }
205 mEntry = jEntries.next(); 207 mEntry = jEntries.next();
206 } 208 }
207} 209}
208 210
209void KOJournalView::showDates(const QDate &start, const QDate &) 211void KOJournalView::showDates(const QDate &start, const QDate &)
210{ 212{
211 mDate = start; 213 mDate = start;