author | zautrix <zautrix> | 2005-07-05 05:29:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-05 05:29:02 (UTC) |
commit | 5992ea9025ebddde8be72322c90aac8edeaf4d1c (patch) (side-by-side diff) | |
tree | f0d9385d80fe74af453aa23fd69715d66aeaee12 | |
parent | 671d832454c8b68e0bb44e439f28fb1c768e033d (diff) | |
download | kdepimpi-5992ea9025ebddde8be72322c90aac8edeaf4d1c.zip kdepimpi-5992ea9025ebddde8be72322c90aac8edeaf4d1c.tar.gz kdepimpi-5992ea9025ebddde8be72322c90aac8edeaf4d1c.tar.bz2 |
rf
-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 @@ -1645,50 +1645,52 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) //qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove); if ( item ) { blockSignals( true ); //qDebug("item found "); item->hide(); item->setCellX(-2, -1 ); item->select(false); mUnusedItems.append( item ); 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 dt = todo->dtDue(); if ( overdue ) { days += todo->dtDue().date().daysTo( currentDate ); } else currentDate = dt.date(); if (( todo->doesFloat() || overdue) && !todo->hasCompletedDate() ) { diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index f855b03..8675ff6 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -471,55 +471,64 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) } QPixmap * KOAgendaItem::paintPix() { static QPixmap* mPaintPix = 0; if ( ! mPaintPix ) { int w = QApplication::desktop()->width(); 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 "); globalFlagBlockAgendaItemUpdate = 1; if ( mSelected ) return; } int rx, ry, rw, rh; rx = e->rect().x(); ry = e->rect().y(); rw = e->rect().width(); diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 3ed68b0..99c564a 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -90,48 +90,49 @@ class KOAgendaItem : public QWidget void setItemDate(QDate qd); void setText ( const QString & text ) { mDisplayedText = text; } QString text () { return mDisplayedText; } virtual bool eventFilter ( QObject *, QEvent * ); static QToolTipGroup *toolTipGroup(); 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 int xPaintCoord; int yPaintCoord; int wPaintCoord; int hPaintCoord; // Variables to remember start position int mStartCellX; int mStartCellXWidth; int mStartCellYTop,mStartCellYBottom; |