[KPhotoAlbum] Cache size

Robert Krawitz rlk at alum.mit.edu
Sun Jan 24 04:31:39 GMT 2016


I submitted this a while back to correctly compute the cache size when
it's more than 2 GB.  For that matter, the upper limit should be
raised, probably to at least 16 GB.

--------------------------- Viewer/ImageDisplay.cpp ---------------------------
index 5247f72..44680f5 100644
@@ -567,7 +567,7 @@ void Viewer::ImageDisplay::setImageList( const DB::FileNameList& list )
 
 void Viewer::ImageDisplay::updatePreload()
 {
-    const int cacheSize = ( Settings::SettingsData::instance()->viewerCacheSize() * 1024 * 1024 ) / (width()*height()*4);
+    const int cacheSize = (int) ((long long) ( Settings::SettingsData::instance()->viewerCacheSize() * 1024LL * 1024LL ) / (width()*height()*4));
     bool cacheFull = (m_cache.count() > cacheSize);
 
     int incr = ( m_forward ? 1 : -1 );


-- 
Robert Krawitz                                     <rlk at alum.mit.edu>

***  MIT Engineers   A Proud Tradition   http://mitathletics.com  ***
Member of the League for Programming Freedom  --  http://ProgFree.org
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton



More information about the Kphotoalbum mailing list