-rw-r--r-- | korganizer/koagenda.cpp | 6 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 11 | ||||
-rw-r--r-- | korganizer/koagendaitem.h | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 01cef35..0280c74 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -1653,34 +1653,36 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) mItems.remove( item ); QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); KOAgendaItem *itemit; //globalFlagBlockAgendaItemPaint = 1; for ( itemit=oldconflictItems.first(); itemit != 0; itemit=oldconflictItems.next() ) { if ( itemit != item ) placeSubCells(itemit); } qApp->processEvents(); //globalFlagBlockAgendaItemPaint = 0; for ( itemit=oldconflictItems.first(); itemit != 0; itemit=oldconflictItems.next() ) { globalFlagBlockAgendaItemUpdate = 0; if ( itemit != item ) itemit->repaintMe(); - globalFlagBlockAgendaItemUpdate = 1; - itemit->repaint(); + globalFlagBlockAgendaItemUpdate = 1; + //qDebug("sigleshot "); + QTimer::singleShot( 0, itemit, SLOT ( repaintItem() )); + //itemit->repaint( false ); repaintItem() } blockSignals( false ); } if ( remove ) { //qDebug("remove****************************************** "); return; } if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) return; //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); QDate currentDate = QDate::currentDate(); bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); QDateTime dt; if ( todo->hasCompletedDate() ) dt = todo->completed(); else diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index f855b03..8675ff6 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -479,39 +479,48 @@ QPixmap * KOAgendaItem::paintPix() int h = QApplication::desktop()->height(); mPaintPix = new QPixmap(w,h); } return mPaintPix ; } QPixmap * KOAgendaItem::paintPixAllday() { static QPixmap* mPaintPixA = 0; if ( ! mPaintPixA ) { int w = QApplication::desktop()->width(); int h = QApplication::desktop()->height()/5; mPaintPixA = new QPixmap(w,h); } return mPaintPixA ; } +void KOAgendaItem::repaintItem() +{ + globalFlagBlockAgendaItemPaint = 0; + globalFlagBlockAgenda = 0; + //qDebug("AAA "); + repaint( false ); + //qDebug("BBB "); +} void KOAgendaItem::paintEvent ( QPaintEvent *e ) { - + qDebug("CCC "); if ( globalFlagBlockAgendaItemPaint ) return; if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) return; + qDebug("DDD "); int yy; if ( mAllDay ) yy = y(); else yy = mCellYTop * ( height() / cellHeight() ); int xx = x(); if ( xPaintCoord != xx || yPaintCoord != yy || wPaintCoord != width() || hPaintCoord != height()) { xPaintCoord= xx; yPaintCoord = yy; wPaintCoord = width(); hPaintCoord = height(); globalFlagBlockAgendaItemUpdate = 0; paintMe( mSelected ); //qDebug("calling paintMe "); diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 3ed68b0..99c564a 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -98,32 +98,33 @@ class KOAgendaItem : public QWidget QPtrList<KOAgendaItem> conflictItems(); void setConflictItems(QPtrList<KOAgendaItem>); void addConflictItem(KOAgendaItem *ci); void paintMe( bool, QPainter* painter = 0 ); void repaintMe(); static QPixmap * paintPix(); static QPixmap * paintPixAllday(); void updateItem(); void computeText(); void recreateIncidence(); bool checkLayout(); void initColor (); public slots: bool updateIcons( QPainter *, bool ); void select(bool=true); + void repaintItem(); protected: void dragEnterEvent(QDragEnterEvent *e); void dropEvent(QDropEvent *e); void paintEvent ( QPaintEvent * ); void resizeEvent ( QResizeEvent *ev ); private: KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; bool mAllDay; bool mWhiteText; int mCellX; int mCellXWidth; int mCellYTop,mCellYBottom; int mSubCell; // subcell number of this item int mSubCells; // Total number of subcells in cell of this item |