summaryrefslogtreecommitdiffabout
path: root/korganizer/kojournalview.cpp
Side-by-side diff
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()
}
showDates( mDate, QDate() );
}
void KOJournalView::flushView()
{
+ static bool ff = false;
+ if ( ff ) return;
+ ff = true;
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->flushEntry();
mEntry = jEntries.next();
}
+ ff = false;
}
void KOJournalView::clearList()
{
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->clear();
mEntry = jEntries.next();
}
}
void KOJournalView::newJournal()
{
+ //qDebug(" KOJournalView::newJournal()");
flushView();
Journal* mJournal = new Journal;
mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
mCalendar->addJournal(mJournal);
showDates( mDate, QDate() );
}
void KOJournalView::showOnly ( Journal* j )
{
+ //qDebug("showOnly %x ", j);
flushView();
if ( j == 0 ) {
showDates( mDate, QDate() );
return;
}
QPtrList<Journal> jl;
@@ -157,38 +163,45 @@ void KOJournalView::showOnly ( Journal* j )
showList( jl );
JournalEntry* mEntry = jEntries.first();
mEntry->setShowOnly();
}
void KOJournalView::showList(QPtrList<Journal> jl)
{
+ //qDebug("KOJournalView::showList %d",jl.count() );
JournalEntry* mEntry = jEntries.first();
JournalEntry* firstEntry = mEntry;
int count = jl.count();
int iii = 0;
while ( iii < count ) {
if ( !mEntry ) {
mEntry = getNewEntry();
mEntry->show();
+ mEntry->setVisibleMode( true );
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii));
mEntry = 0;
- } else {
+ } else {
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii));
mEntry->show();
+ mEntry->setVisibleMode( true );
mEntry = jEntries.next();
}
++iii;
}
while ( mEntry ) {
mEntry->setDate(mDate);
mEntry->clear();
- if ( mEntry != firstEntry )
+ if ( mEntry != firstEntry ) {
mEntry->hide();
- else
+ mEntry->setVisibleMode( false );
+ }
+ else {
+ mEntry->setVisibleMode( true );
mEntry->show();
+ }
mEntry = jEntries.next();
}
}
void KOJournalView::showDates(const QDate &start, const QDate &)
{