Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/util/qcompleter.cpp

    r651 r769  
    528528    cost = cost + m.indices.cost() - old.indices.cost();
    529529    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        ) {
    532532            CacheItem& ci = it1.value();
    533533            int sz = ci.count()/2;
    534534            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) {
    536537                cost -= it2.value().indices.cost();
    537                 ci.erase(it2);
     538                it2 = ci.erase(it2);
     539                i++;
    538540            }
    539             if (ci.count() == 0)
    540                 cache.erase(it1);
     541            if (ci.count() == 0) {
     542              it1 = cache.erase(it1);
     543            } else {
     544              ++it1;
     545            }
    541546        }
    542547    }
     
    17491754    This signal is sent when an item in the popup() is highlighted by
    17501755    the user. It is also sent if complete() is called with the completionMode()
    1751     set to QCOmpleter::InlineCompletion. The item's \a text is given.
     1756    set to QCmpleter::InlineCompletion. The item's \a text is given.
    17521757*/
    17531758
Note: See TracChangeset for help on using the changeset viewer.