summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp14
-rw-r--r--korganizer/komonthview.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 9b0389d..00e5a6f 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -286,48 +286,60 @@ MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
setText( s );
mMultiday = 0;
mIncidence = incidence;
mDate = qd;
mRecur = false;
mAlarm = false;
mReply = false;
mInfo = false;
mdayPos = 0;
isWeekItem = KOPrefs::instance()->mMonthViewWeek;
}
void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s)
{
mDisplayHightlighted = false;
setText( s );
mMultiday = 0;
mIncidence = incidence;
mDate = qd;
mRecur = false;
mAlarm = false;
mReply = false;
mInfo = false;
mdayPos = 0;
}
+void MonthViewItem::clearData()
+{
+ mDisplayHightlighted = false;
+ setText( "" );
+ mMultiday = 0;
+ mIncidence = 0;
+ mRecur = false;
+ mAlarm = false;
+ mReply = false;
+ mInfo = false;
+ mdayPos = 0;
+}
bool MonthViewItem::setHighlightedFalse()
{
if ( !mDisplayHightlighted )
return false;
mDisplayHightlighted = false;
return true;
}
bool MonthViewItem::setHighlighted( Incidence * inc )
{
if ( inc == mIncidence ) {
if ( mDisplayHightlighted )
return false;
mDisplayHightlighted = true;
return true;
} else {
if ( !mDisplayHightlighted )
return false;
mDisplayHightlighted = false;
return true;
}
return false;
}
void MonthViewItem::paint(QPainter *p)
@@ -634,48 +646,50 @@ void MonthViewCell::startUpdateCell()
return;
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
while ( mitem ) {
mitem->setBlockRepaint( true );
mitem = (MonthViewItem *)mitem->next();
}
if ( mAvailItemList.count() > 20 ) {
mAvailItemList.setAutoDelete( true );
mAvailItemList.clear();
mAvailItemList.setAutoDelete( false );
clear();
}
setPrimary( mDate.month()%2 );
setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays);
if ( mDate == QDate::currentDate() ) {
setLineWidth( 3 );
} else {
setLineWidth( 1 );
}
MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem ();
//clear();
while ( CurrentAvailItem ) {
MonthViewItem *item = CurrentAvailItem;
+ //item->setHighlightedFalse();
+ item->clearData();
CurrentAvailItem = (MonthViewItem *)item->next();
mAvailItemList.append( item );
takeItem ( item );
}
#ifdef DESKTOP_VERSION
QToolTip::remove(this);
#endif
mToolTip.clear();
//qApp->processEvents();
#if 0
if ( !mHolidayString.isEmpty() ) {
MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
item->setPalette( mHolidayPalette );
insertItem( item );
mToolTip.append ( mHolidayString );
}
#endif
}
int MonthViewCell::insertEvent(Event *event)
{
bool useToolTips = true;
#ifndef DESKTOP_VERSION
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 159af16..ac97860 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -86,48 +86,49 @@ class KNoScrollListBox: public QListBox
void rightClick();
void nextCell();
void prevCell();
void highligtIncidence( Incidence * , MonthViewCell*, int );
protected slots:
void oneDown();
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
void mousePressEvent(QMouseEvent *);
void focusInEvent ( QFocusEvent * );
void focusOutEvent ( QFocusEvent * );
private:
bool resetOnFocusIn;
KNOWhatsThis * mWT;
};
class MonthViewItem: public QListBoxItem
{
public:
MonthViewItem( Incidence *, QDate qd, const QString & title );
void recycle( Incidence *incidence, QDate qd, const QString & s);
+ void clearData();
void setRecur(bool on) { mRecur = on; }
void setAlarm(bool on) { mAlarm = on; }
void setReply(bool on) { mReply = on; }
void setMoreInfo(bool on) { mInfo = on; }
void setMultiDay(int type) { mMultiday = type; }
int multiDay() { return mMultiday; }
void setMultiDayPos(int type) { mdayPos = type; }
int gettMultiDayPos() { return mdayPos; }
void setBlockRepaint(bool on) { mblockRepaint = on; }
bool setHighlighted( Incidence * );
void setPalette(const QPalette &p) { mPalette = p; }
QPalette palette() const { return mPalette; }
bool setHighlightedFalse();
Incidence *incidence() const { return mIncidence; }
QDate incidenceDate() { return mDate; }
protected:
virtual void paint(QPainter *);
virtual int height(const QListBox *) const;
virtual int width(const QListBox *) const;
private:
int mdayPos;