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.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index a23a3b2..406df5a 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -28,24 +28,25 @@
#include <qscrollview.h>
#include <qpopupmenu.h>
#include <qhbox.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qapplication.h>
#include <klocale.h>
#include <kdebug.h>
#include "koprefs.h"
#include <kglobal.h>
+#include <ktextedit.h>
#include <libkcal/calendar.h>
#include "journalentry.h"
#include "kojournalview.h"
using namespace KOrg;
KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
const char *name)
: KOrg::BaseView(calendar, parent, name)
{
@@ -168,39 +169,47 @@ void KOJournalView::showOnly ( Journal* j )
mEntry->setShowOnly();
}
void KOJournalView::showList(QPtrList<Journal> jl)
{
static bool ff = false;
if ( ff ) return;
ff = true;
//qDebug("KOJournalView::showList %d",jl.count() );
JournalEntry* mEntry = jEntries.first();
JournalEntry* firstEntry = mEntry;
int count = jl.count();
int iii = 0;
+ QWidget* fw = qApp->focusWidget ();
while ( iii < count ) {
if ( !mEntry ) {
mEntry = getNewEntry();
mEntry->setVisibleMode( true );
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii), false);
mEntry->setVisibleMode( true );
mEntry->show();
mEntry = 0;
} else {
+ int xxx = -1, yyy = -1;
+ if ( ((QWidget*) mEntry->editor() ) == fw ) {
+ mEntry->editor()->getCursorPosition( &xxx,&yyy);
+ }
mEntry->setVisibleMode( true );
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii), false);
mEntry->setVisibleMode( true );
mEntry->show();
+ if ( xxx > -1 && yyy > -1 ) {
+ mEntry->editor()->setCursorPosition( xxx, yyy );
+ }
mEntry = jEntries.next();
}
++iii;
}
while ( mEntry ) {
mEntry->setDate(mDate);
mEntry->clear();
if ( mEntry != firstEntry ) {
mEntry->hide();
mEntry->setVisibleMode( false );
}
else {