summaryrefslogtreecommitdiffabout
path: root/korganizer/kojournalview.cpp
authorzautrix <zautrix>2005-06-30 06:35:25 (UTC)
committer zautrix <zautrix>2005-06-30 06:35:25 (UTC)
commit0fc571a7eadda739fd1a93d627e7129b9956c9f6 (patch) (unidiff)
tree60336a1e91259ab654e292dbe9938af4ecdf7a72 /korganizer/kojournalview.cpp
parentda264cf19c0183d6ea4e8dab6eabd40994e351c8 (diff)
downloadkdepimpi-0fc571a7eadda739fd1a93d627e7129b9956c9f6.zip
kdepimpi-0fc571a7eadda739fd1a93d627e7129b9956c9f6.tar.gz
kdepimpi-0fc571a7eadda739fd1a93d627e7129b9956c9f6.tar.bz2
fixes
Diffstat (limited to 'korganizer/kojournalview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index cb9a2c0..b659d53 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -118,38 +118,44 @@ void KOJournalView::updateView()
118 } 118 }
119 showDates( mDate, QDate() ); 119 showDates( mDate, QDate() );
120} 120}
121 121
122void KOJournalView::flushView() 122void KOJournalView::flushView()
123{ 123{
124 static bool ff = false;
125 if ( ff ) return;
126 ff = true;
124 JournalEntry* mEntry = jEntries.first(); 127 JournalEntry* mEntry = jEntries.first();
125 while ( mEntry ) { 128 while ( mEntry ) {
126 mEntry->flushEntry(); 129 mEntry->flushEntry();
127 mEntry = jEntries.next(); 130 mEntry = jEntries.next();
128 } 131 }
132 ff = false;
129} 133}
130 134
131void KOJournalView::clearList() 135void KOJournalView::clearList()
132{ 136{
133 JournalEntry* mEntry = jEntries.first(); 137 JournalEntry* mEntry = jEntries.first();
134 while ( mEntry ) { 138 while ( mEntry ) {
135 mEntry->clear(); 139 mEntry->clear();
136 mEntry = jEntries.next(); 140 mEntry = jEntries.next();
137 } 141 }
138} 142}
139void KOJournalView::newJournal() 143void KOJournalView::newJournal()
140{ 144{
145 //qDebug(" KOJournalView::newJournal()");
141 flushView(); 146 flushView();
142 Journal* mJournal = new Journal; 147 Journal* mJournal = new Journal;
143 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); 148 mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
144 mCalendar->addJournal(mJournal); 149 mCalendar->addJournal(mJournal);
145 showDates( mDate, QDate() ); 150 showDates( mDate, QDate() );
146} 151}
147 152
148void KOJournalView::showOnly ( Journal* j ) 153void KOJournalView::showOnly ( Journal* j )
149{ 154{
155 //qDebug("showOnly %x ", j);
150 flushView(); 156 flushView();
151 if ( j == 0 ) { 157 if ( j == 0 ) {
152 showDates( mDate, QDate() ); 158 showDates( mDate, QDate() );
153 return; 159 return;
154 } 160 }
155 QPtrList<Journal> jl; 161 QPtrList<Journal> jl;
@@ -157,38 +163,45 @@ void KOJournalView::showOnly ( Journal* j )
157 showList( jl ); 163 showList( jl );
158 JournalEntry* mEntry = jEntries.first(); 164 JournalEntry* mEntry = jEntries.first();
159 mEntry->setShowOnly(); 165 mEntry->setShowOnly();
160} 166}
161void KOJournalView::showList(QPtrList<Journal> jl) 167void KOJournalView::showList(QPtrList<Journal> jl)
162{ 168{
169 //qDebug("KOJournalView::showList %d",jl.count() );
163 JournalEntry* mEntry = jEntries.first(); 170 JournalEntry* mEntry = jEntries.first();
164 JournalEntry* firstEntry = mEntry; 171 JournalEntry* firstEntry = mEntry;
165 int count = jl.count(); 172 int count = jl.count();
166 int iii = 0; 173 int iii = 0;
167 while ( iii < count ) { 174 while ( iii < count ) {
168 if ( !mEntry ) { 175 if ( !mEntry ) {
169 mEntry = getNewEntry(); 176 mEntry = getNewEntry();
170 mEntry->show(); 177 mEntry->show();
178 mEntry->setVisibleMode( true );
171 mEntry->setDate(mDate); 179 mEntry->setDate(mDate);
172 mEntry->setJournal(jl.at(iii)); 180 mEntry->setJournal(jl.at(iii));
173 mEntry = 0; 181 mEntry = 0;
174 } else { 182 } else {
175 mEntry->setDate(mDate); 183 mEntry->setDate(mDate);
176 mEntry->setJournal(jl.at(iii)); 184 mEntry->setJournal(jl.at(iii));
177 mEntry->show(); 185 mEntry->show();
186 mEntry->setVisibleMode( true );
178 mEntry = jEntries.next(); 187 mEntry = jEntries.next();
179 } 188 }
180 ++iii; 189 ++iii;
181 } 190 }
182 while ( mEntry ) { 191 while ( mEntry ) {
183 mEntry->setDate(mDate); 192 mEntry->setDate(mDate);
184 mEntry->clear(); 193 mEntry->clear();
185 if ( mEntry != firstEntry ) 194 if ( mEntry != firstEntry ) {
186 mEntry->hide(); 195 mEntry->hide();
187 else 196 mEntry->setVisibleMode( false );
197 }
198 else {
199 mEntry->setVisibleMode( true );
188 mEntry->show(); 200 mEntry->show();
201 }
189 mEntry = jEntries.next(); 202 mEntry = jEntries.next();
190 } 203 }
191} 204}
192 205
193void KOJournalView::showDates(const QDate &start, const QDate &) 206void KOJournalView::showDates(const QDate &start, const QDate &)
194{ 207{