Changeset 769 for trunk/src/gui/util/qcompleter.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/util/qcompleter.cpp
r651 r769 528 528 cost = cost + m.indices.cost() - old.indices.cost(); 529 529 if (cost * sizeof(int) > 1024 * 1024) { 530 QMap<QModelIndex, CacheItem>::iterator it1 ;531 for (it1 = cache.begin(); it1 != cache.end(); ++it1) {530 QMap<QModelIndex, CacheItem>::iterator it1 ; 531 ) { 532 532 CacheItem& ci = it1.value(); 533 533 int sz = ci.count()/2; 534 534 QMap<QString, QMatchData>::iterator it2 = ci.begin(); 535 for (int i = 0; it2 != ci.end() && i < sz; i++, ++it2) { 535 int i = 0; 536 while (it2 != ci.end() && i < sz) { 536 537 cost -= it2.value().indices.cost(); 537 ci.erase(it2); 538 it2 = ci.erase(it2); 539 i++; 538 540 } 539 if (ci.count() == 0) 540 cache.erase(it1); 541 if (ci.count() == 0) { 542 it1 = cache.erase(it1); 543 } else { 544 ++it1; 545 } 541 546 } 542 547 } … … 1749 1754 This signal is sent when an item in the popup() is highlighted by 1750 1755 the user. It is also sent if complete() is called with the completionMode() 1751 set to QC Ompleter::InlineCompletion. The item's \a text is given.1756 set to QCmpleter::InlineCompletion. The item's \a text is given. 1752 1757 */ 1753 1758
Note:
See TracChangeset
for help on using the changeset viewer.