summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
authorzautrix <zautrix>2005-01-19 22:57:42 (UTC)
committer zautrix <zautrix>2005-01-19 22:57:42 (UTC)
commitade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e (patch) (side-by-side diff)
tree990ed560fbf9126fba2abdaf98c036cddad2d94f /korganizer/komonthview.cpp
parenta9f8ad6916ea1a849a43fe49c4085f6c44b5c47b (diff)
downloadkdepimpi-ade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e.zip
kdepimpi-ade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e.tar.gz
kdepimpi-ade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e.tar.bz2
many view fixes
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp89
1 files changed, 56 insertions, 33 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 9344567..842f6eb 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -81,5 +81,8 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
#endif
- new KNOWhatsThis(this);
+ mWT = new KNOWhatsThis(this);
+}
+KNoScrollListBox::~KNoScrollListBox()
+{
+ delete mWT;
}
-
QString KNoScrollListBox::getWhatsThisText(QPoint p)
@@ -310,16 +313,5 @@ void MonthViewCell::setDate( const QDate &date )
// kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl;
-
mDate = date;
- QString text;
- bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
- if ( KOGlobals::self()->calendarSystem()->day( date ) == 1 || (date.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
- text = KOGlobals::self()->calendarSystem()->monthName( date, true ) + " ";
- mLabel->resize( mLabelBigSize );
- text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
- } else {
- mLabel->resize( mLabelSize );
- text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
- }
- mLabel->setText( text );
+
@@ -394,3 +386,7 @@ void MonthViewCell::updateCell()
{
-
+ if ( !mMonthView->isUpdatePossible() )
+ return;
+ if ( !isVisible() ){
+ return;
+ }
setPrimary( mDate.month()%2 );
@@ -403,2 +399,5 @@ void MonthViewCell::updateCell()
mItemList->clear();
+
+
+
#ifdef DESKTOP_VERSION
@@ -417,3 +416,12 @@ void MonthViewCell::updateCell()
Event *event;
- for( event = events.first(); event; event = events.next() ) {
+ for( event = events.first(); event; event = events.next() ) { // for event
+
+ if ( !(event->doesRecur() == Recurrence::rNone) ) {
+ if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
+ continue;
+ else
+ if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
+ continue;
+ }
+
if ( event->categories().contains("Holiday") ||
@@ -485,2 +493,3 @@ void MonthViewCell::updateCell()
item->setMoreInfo( event->description().length() > 0 );
+#ifdef DESKTOP_VERSION
Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails,
@@ -494,16 +503,6 @@ void MonthViewCell::updateCell()
item->setReply(false);
- bool insert = true;
- if ( !(event->doesRecur() == Recurrence::rNone) ) {
- if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
- insert = false;
- else
- if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
- insert = false;
-
- }
- if ( insert ) {
- mItemList->insertItem( item );
- tipText += "\n";
- } else
- tipText = "";
+#endif
+ mItemList->insertItem( item );
+ tipText += "\n";
+
}
@@ -559,5 +558,16 @@ void MonthViewCell::updateCell()
setMyPalette();
+ QString text;
+ bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
+ if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
+ text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
+ mLabel->resize( mLabelBigSize );
+ text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
+ } else {
+ mLabel->resize( mLabelSize );
+ text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
+ }
+ mLabel->setText( text );
resizeEvent( 0 );
// if ( isVisible())
- // qApp->processEvents();
+ qApp->processEvents();
}
@@ -640,2 +650,7 @@ void MonthViewCell::resizeEvent ( QResizeEvent * )
{
+ if ( !mMonthView->isUpdatePossible() )
+ return;
+ if ( !isVisible() ){
+ return;
+ }
int size = height() - mLabel->height();
@@ -715,2 +730,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
{
+ updatePossible = false;
mCells.setAutoDelete( true );
@@ -922,3 +938,6 @@ void KOMonthView::updateView()
{
-
+ static int iii = 0;
+ ++iii;
+ if ( !updatePossible )
+ return;
uint i;
@@ -956,3 +975,3 @@ void KOMonthView::computeLayout()
return;
-
+ //qDebug("KOMonthView::computeLayout()------------------------------------ ");
QFontMetrics fm ( mWeekLabels[0]->font() );
@@ -1034,2 +1053,6 @@ void KOMonthView::computeLayout()
updateDayLabels();
+ bool forceUpdate = !updatePossible;
+ updatePossible = true;
+ if ( forceUpdate )
+ updateView();
}