diff options
| author | Peter Penz <[email protected]> | 2012-03-20 17:19:12 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-03-20 17:23:28 +0100 |
| commit | 03a65da80aea562ea51bf6db12a30a1acf097368 (patch) | |
| tree | 4a296f22413042ed0f65fe463c97eb21d4a82751 /src/kitemviews/kfileitemmodel.cpp | |
| parent | 0dcb51b927f70afa6cba0b9185abb1f323052696 (diff) | |
KFileItemModel: Remove minimum-update timer
The timer became unnecessary after introducing the behavior to
collect all new items until KDirLister emits a completed()-signal.
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 0fef47787..4b9f2f00e 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -44,11 +44,9 @@ KFileItemModel::KFileItemModel(KDirLister* dirLister, QObject* parent) : m_filter(), m_filteredItems(), m_requestRole(), - m_minimumUpdateIntervalTimer(0), m_maximumUpdateIntervalTimer(0), m_resortAllItemsTimer(0), m_pendingItemsToInsert(), - m_pendingEmitLoadingCompleted(false), m_groups(), m_expandedParentsCountRoot(UninitializedExpandedParentsCountRoot), m_expandedUrls(), @@ -71,14 +69,6 @@ KFileItemModel::KFileItemModel(KDirLister* dirLister, QObject* parent) : connect(dirLister, SIGNAL(clear()), this, SLOT(slotClear())); connect(dirLister, SIGNAL(clear(KUrl)), this, SLOT(slotClear(KUrl))); - // Although the layout engine of KItemListView is fast it is very inefficient to e.g. - // emit 50 itemsInserted()-signals each 100 ms. m_minimumUpdateIntervalTimer assures that updates - // are done in 1 second intervals for equal operations. - m_minimumUpdateIntervalTimer = new QTimer(this); - m_minimumUpdateIntervalTimer->setInterval(1000); - m_minimumUpdateIntervalTimer->setSingleShot(true); - connect(m_minimumUpdateIntervalTimer, SIGNAL(timeout()), this, SLOT(dispatchPendingItemsToInsert())); - // For slow KIO-slaves like used for searching it makes sense to show results periodically even // before the completed() or canceled() signal has been emitted. m_maximumUpdateIntervalTimer = new QTimer(this); @@ -95,8 +85,6 @@ KFileItemModel::KFileItemModel(KDirLister* dirLister, QObject* parent) : m_resortAllItemsTimer->setSingleShot(true); connect(m_resortAllItemsTimer, SIGNAL(timeout()), this, SLOT(resortAllItems())); - Q_ASSERT(m_minimumUpdateIntervalTimer->interval() <= m_maximumUpdateIntervalTimer->interval()); - connect(KGlobalSettings::self(), SIGNAL(naturalSortingChanged()), this, SLOT(slotNaturalSortingChanged())); } @@ -661,14 +649,6 @@ void KFileItemModel::resortAllItems() void KFileItemModel::slotCompleted() { - if (m_urlsToExpand.isEmpty() && m_minimumUpdateIntervalTimer->isActive()) { - // dispatchPendingItems() will be called when the timer - // has been expired. - m_pendingEmitLoadingCompleted = true; - return; - } - - m_pendingEmitLoadingCompleted = false; dispatchPendingItemsToInsert(); if (!m_urlsToExpand.isEmpty()) { @@ -694,12 +674,10 @@ void KFileItemModel::slotCompleted() } emit loadingCompleted(); - m_minimumUpdateIntervalTimer->start(); } void KFileItemModel::slotCanceled() { - m_minimumUpdateIntervalTimer->stop(); m_maximumUpdateIntervalTimer->stop(); dispatchPendingItemsToInsert(); } @@ -858,7 +836,6 @@ void KFileItemModel::slotClear() m_filteredItems.clear(); m_groups.clear(); - m_minimumUpdateIntervalTimer->stop(); m_maximumUpdateIntervalTimer->stop(); m_resortAllItemsTimer->stop(); m_pendingItemsToInsert.clear(); @@ -893,10 +870,6 @@ void KFileItemModel::dispatchPendingItemsToInsert() insertItems(m_pendingItemsToInsert); m_pendingItemsToInsert.clear(); } - - if (m_pendingEmitLoadingCompleted) { - emit loadingCompleted(); - } } void KFileItemModel::insertItems(const KFileItemList& items) |
