Changeset 38


Ignore:
Timestamp:
05/27/08 18:22:54 (4 years ago)
Author:
antonbatenev.ya.ru
Message:

"вытянуть всю базу" - установка макс количества сообщений за раз.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/form_main.cpp

    r37 r38  
    224224        int from  = 0; 
    225225 
     226        const int count_per_request = 1000; 
     227 
    226228        while (count != 0) 
    227229        { 
     
    229231                QList<int> ids; 
    230232 
    231                 while (ids.count() < 1000) 
     233                while (ids.count() < count_per_request) 
    232234                { 
    233235                        QList<int> exists; 
    234236 
    235237                        // получение уже загруженных id 
    236                         if (storage->GetMessageIds(from, from + 1000, exists, NULL) == false) 
     238                        if (storage->GetMessageIds(from, from + count_per_request, exists, NULL) == false) 
    237239                        { 
    238240                                storage->ShowError(this); 
     
    241243 
    242244                        // анализ существующих 
    243                         for (int i = from; i < from + 1000; i++) 
     245                        for (int i = from; i < from + count_per_request; i++) 
    244246                        { 
    245247                                int idx = exists.indexOf(i); 
     
    253255                                ids.append(i); 
    254256 
    255                                 if (ids.count() == 1000) 
     257                                if (ids.count() == count_per_request) 
    256258                                        break; 
    257259                        } 
     
    260262                                from = ids[ids.count() - 1] + 1; 
    261263                        else 
    262                                 from += 1000; 
     264                                from += count_per_request; 
    263265                } 
    264266 
Note: See TracChangeset for help on using the changeset viewer.