summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 82437d8..99402c4 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -200,25 +200,29 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
itemMargin() ||
p.x() < header()->sectionPos(header()->mapToIndex(0))) {
if (e->button()==Qt::LeftButton) {
mPressPos = e->pos();
mMousePressed = true;
}
}
}
#endif
QListView::contentsMousePressEvent(e);
}
-
+void KOTodoListView::paintEvent(QPaintEvent* e)
+{
+ emit paintNeeded();
+ QListView::paintEvent( e);
+}
void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
{
#ifndef KORG_NODND
QListView::contentsMouseMoveEvent(e);
if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
QApplication::startDragDistance()) {
mMousePressed = false;
QListViewItem *item = itemAt(contentsToViewport(mPressPos));
if (item) {
DndFactory factory( mCalendar );
ICalDrag *vd = factory.createDrag(
@@ -492,24 +496,26 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
SLOT( itemClicked( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
SLOT( itemDoubleClicked( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
SLOT( updateView() ) );
connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
SLOT( todoModified(Todo *, int) ) );
connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
SLOT( itemStateChanged( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
SLOT( itemStateChanged( QListViewItem * ) ) );
+ connect( mTodoListView, SIGNAL( paintNeeded() ),
+ SLOT( paintNeeded()) );
#if 0
connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
#endif
connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
@@ -525,33 +531,40 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
KOTodoView::~KOTodoView()
{
delete mDocPrefs;
}
void KOTodoView::jumpToDate ()
{
// if (mActiveItem) {
// mActiveItem->todo());
// if ( mActiveItem->todo()->hasDueDate() )
// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
}
+void KOTodoView::paintNeeded()
+{
+ if ( mPendingUpdateBeforeRepaint ) {
+ updateView();
+ mPendingUpdateBeforeRepaint = false;
+ }
+}
void KOTodoView::paintEvent(QPaintEvent * pevent)
{
if ( mPendingUpdateBeforeRepaint ) {
updateView();
mPendingUpdateBeforeRepaint = false;
}
KOrg::BaseView::paintEvent( pevent);
}
- bool mPendingUpdateBeforeRepaint;
+
void KOTodoView::updateView()
{
pendingSubtodo = 0;
if ( mBlockUpdate ) {
return;
}
if ( !isVisible() ) {
mPendingUpdateBeforeRepaint = true;
return;
}
//qDebug("KOTodoView::updateView() %x", this);
if ( isFlatDisplay ) {