hgcacheproxymodel/src/hgbuffermanager.cpp
changeset 8 15f034b8a3b5
parent 5 4fa04caf0f43
child 7 5ebec3429918
equal deleted inserted replaced
5:4fa04caf0f43 8:15f034b8a3b5
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 *  Version     : %version: 5 %
    16 *  Version     : %version: 6 %
    17 */
    17 */
    18 #include "hgbuffermanager.h"
    18 #include "hgbuffermanager.h"
    19 #include <hgwidgets/hgcacheproxymodel.h>
    19 #include <hgwidgets/hgcacheproxymodel.h>
    20 
    20 
    21 
    21 
   199     
   199     
   200     if(mBufferPosition < 0 ){
   200     if(mBufferPosition < 0 ){
   201         mBufferPosition = 0;
   201         mBufferPosition = 0;
   202     }
   202     }
   203     
   203     
   204     //request new Buffer
   204     if (mBufferPosition>1){
   205     mRequestStart = mBufferPosition;
   205         mObserver->release(0, mBufferPosition-1);
   206     mRequestCount = mBufferSize;
   206     }
   207     mResetOrdered = true;
   207     
   208     calculate();
   208     mObserver->request( mBufferPosition, 
       
   209                         mBufferPosition + mBufferSize -1 );
       
   210 
       
   211     if (mBufferPosition + mBufferSize < mTotalCount){
       
   212         mObserver->release(mBufferPosition + mBufferSize, mTotalCount);
       
   213     }
       
   214     
       
   215     mDiff = 0;
       
   216     mResetOrdered = false;
       
   217     mRequestStart = 0;
       
   218     mRequestCount = 0;
       
   219     mReleaseStart = 0;
       
   220     mReleaseCount = 0;
       
   221     
   209 }
   222 }
   210 
   223 
   211 void HgBufferManager::aboutToRemoveItem(int pos)
   224 void HgBufferManager::aboutToRemoveItem(int pos)
   212 {
   225 {
   213     if(pos < 0 || pos >= mTotalCount ){
   226     if(pos < 0 || pos >= mTotalCount ){