summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp38
1 files changed, 27 insertions, 11 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index c037d0d..f173ecc 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -98,6 +98,2 @@ namespace {
98 if ( isDir ) { 98 if ( isDir ) {
99 if (_dirPix && _dirPix->width()!=m_iconsize) {
100 delete _dirPix;
101 _dirPix = 0;
102 }
103 if (!_dirPix ) { 99 if (!_dirPix ) {
@@ -115,6 +111,2 @@ namespace {
115 { 111 {
116 if (_cpyPix && _cpyPix->width()!=m_iconsize) {
117 delete _cpyPix;
118 _cpyPix = 0;
119 }
120 if (_dirPix && _dirPix->width()>m_iconsize) { 112 if (_dirPix && _dirPix->width()>m_iconsize) {
@@ -425,2 +417,3 @@ void PIconView::resetView() {
425 if (m_mode>1) { 417 if (m_mode>1) {
418 int osize = m_iconsize;
426 m_iconsize = m_cfg->readNumEntry("iconsize", 32); 419 m_iconsize = m_cfg->readNumEntry("iconsize", 32);
@@ -428,2 +421,13 @@ void PIconView::resetView() {
428 if (m_iconsize>64)m_iconsize = 64; 421 if (m_iconsize>64)m_iconsize = 64;
422 if (osize != m_iconsize) {
423 if (_dirPix){
424 delete _dirPix;
425 _dirPix = 0;
426 }
427 if (_cpyPix){
428 delete _cpyPix;
429 _cpyPix = 0;
430 }
431 calculateGrid();
432 }
429 } else { 433 } else {
@@ -809,3 +813,10 @@ void PIconView::slotChangeMode( int mode ) {
809 } 813 }
810 814 if (_dirPix){
815 delete _dirPix;
816 _dirPix = 0;
817 }
818 if (_cpyPix){
819 delete _cpyPix;
820 _cpyPix = 0;
821 }
811 calculateGrid(); 822 calculateGrid();
@@ -844,2 +855,3 @@ void PIconView::calculateGrid(QResizeEvent* re)
844 } 855 }
856 int cache = 0;
845 m_view->setItemTextPos( pos ); 857 m_view->setItemTextPos( pos );
@@ -847,7 +859,11 @@ void PIconView::calculateGrid(QResizeEvent* re)
847 case 2: 859 case 2:
860 m_view->setSpacing(2);
848 m_view->setGridX(m_iconsize); 861 m_view->setGridX(m_iconsize);
849 m_view->setGridY(-1); 862 m_view->setGridY(-1);
850 PPixmapCache::self()->setMaxImages(40); 863 cache = (int)((double)64/(double)m_iconsize*40.0);
864 odebug << "cache size: " << cache << oendl;
865 PPixmapCache::self()->setMaxImages(cache);
851 break; 866 break;
852 case 3: 867 case 3:
868 m_view->setSpacing(10);
853 m_view->setGridX( fontMetrics().width("testimage.jpg")+20); 869 m_view->setGridX( fontMetrics().width("testimage.jpg")+20);
@@ -858,2 +874,3 @@ void PIconView::calculateGrid(QResizeEvent* re)
858 default: 874 default:
875 m_view->setSpacing(10);
859 m_view->setGridX( viewerWidth-3*m_view->spacing()); 876 m_view->setGridX( viewerWidth-3*m_view->spacing());
@@ -863,3 +880,2 @@ void PIconView::calculateGrid(QResizeEvent* re)
863 } 880 }
864 m_view->setSpacing(10);
865} 881}