[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim] a0f897e: Reduce calls to reloadIncidences()
From: Tobias Koenig <tokoe () kde ! org>
Date: 2011-01-10 18:59:49
Message-ID: 20110110185949.46D95A6092 () git ! kde ! org
[Download RAW message or body]
commit a0f897e4d66a51dfa0356ee8f2380405b2ccc817
branch master
Author: Tobias Koenig <tokoe@kde.org>
Date: Mon Jan 10 20:01:56 2011 +0100
Reduce calls to reloadIncidences()
Use the reloadTimer for all calls to reloadIncidence(). This will
bring down the calls to reloadIncidence() on initial load from 4 to 2 calls
and on subsequent loadings from >5 to 1 call.
This makes the month view feelable faster.
diff --git a/calendarviews/eventviews/month/monthview.cpp b/calendarviews/eventviews/month/monthview.cpp
index 7d1e7c1..f97e0d3 100644
--- a/calendarviews/eventviews/month/monthview.cpp
+++ b/calendarviews/eventviews/month/monthview.cpp
@@ -95,7 +95,7 @@ void MonthViewPrivate::addIncidence( const Akonadi::Item &incidence )
Q_UNUSED( incidence );
//TODO: add some more intelligence here...
q->setChanges( q->changes() | EventView::IncidencesAdded );
- q->reloadIncidences();
+ reloadTimer.start( 50 );
}
void MonthViewPrivate::moveStartDate( int weeks, int months )
@@ -284,7 +284,7 @@ void MonthView::updateConfig()
*/
d->scene->update();
setChanges( changes() | ConfigChanged );
- QTimer::singleShot( 0, this, SLOT(reloadIncidences()) );
+ d->reloadTimer.start( 50 );
}
int MonthView::currentDateCount() const
@@ -331,7 +331,7 @@ void MonthView::setDateRange( const KDateTime &start, const KDateTime &end )
// d->calendarSearch->setStartDate( actualStartDateTime() );
// d->calendarSearch->setEndDate( actualEndDateTime() );
setChanges( changes() | DatesChanged );
- reloadIncidences();
+ d->reloadTimer.start( 50 );
}
bool MonthView::eventDurationHint( QDateTime &startDt, QDateTime &endDt, bool &allDay ) const
@@ -364,7 +364,7 @@ void MonthView::changeIncidenceDisplay( const Akonadi::Item &incidence, int acti
// called by one of the MonthItem objects. So only schedule a reload
// as event
setChanges( changes() | IncidencesEdited );
- QTimer::singleShot( 0, this, SLOT(reloadIncidences()) );
+ d->reloadTimer.start( 50 );
}
void MonthView::updateView()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic