diff -r 4fa04caf0f43 -r 15f034b8a3b5 hgcacheproxymodel/tsrc/unit/bmhelper.cpp --- a/hgcacheproxymodel/tsrc/unit/bmhelper.cpp Fri Jun 11 14:43:11 2010 +0300 +++ b/hgcacheproxymodel/tsrc/unit/bmhelper.cpp Wed Jun 23 19:25:46 2010 +0300 @@ -13,7 +13,7 @@ * * Description: * -* Version : %version: 5 % +* Version : %version: 6 % */ #include "bmhelper.h" #include @@ -122,6 +122,22 @@ return mBuffer.count(); } +void BMHelper::resizeCache(int newSize) +{ + int diff = totalSize() - newSize; + + while (diff != 0){ + if (diff >0){ + remove(mBuffer.count()-1); + diff--; + }else{ + insert(mBuffer.count()); + diff++; + } + } + +} + void BMHelper::remove(int pos) { if ( pos <0 || pos > mBuffer.count()){