author | alwin <alwin> | 2004-04-19 09:16:15 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-19 09:16:15 (UTC) |
commit | e3ca538f7ce2e7b7df2f29f263778acc342d51db (patch) (unidiff) | |
tree | cb3e3c769ae12542d24eff7d17168635ddef65af /noncore/graphics/opie-eye/gui/iconview.cpp | |
parent | 0b59a16b5a5a179c46ddb3f8c585dbca59b2826e (diff) | |
download | opie-e3ca538f7ce2e7b7df2f29f263778acc342d51db.zip opie-e3ca538f7ce2e7b7df2f29f263778acc342d51db.tar.gz opie-e3ca538f7ce2e7b7df2f29f263778acc342d51db.tar.bz2 |
re-enabled the cache as designed.
for that, pixcache has now a method setting the size of cache (parameter count
of pix) and it will switched between the different views.
setPixmap is overloaded that way, that we don't store the pix inside the
item but calling calcRect which is accessing the cached pixmap. voila.
Zecke: Should we make a configure item where users can setup how much
pix-previews should cache? Should we setup a thumbnail cache like .xvpics?
Diffstat (limited to 'noncore/graphics/opie-eye/gui/iconview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 039f53f..d546b64 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -54,3 +54,5 @@ namespace { | |||
54 | void setTextOnly(bool how){m_textOnly=how;} | 54 | void setTextOnly(bool how){m_textOnly=how;} |
55 | /* just for starting recalc of item rect! */ | ||
55 | virtual void setPixmap( const QPixmap & icon, bool recalc, bool redraw = TRUE ); | 56 | virtual void setPixmap( const QPixmap & icon, bool recalc, bool redraw = TRUE ); |
57 | /* just for starting recalc of item rect! */ | ||
56 | virtual void setPixmap( const QPixmap & icon); | 58 | virtual void setPixmap( const QPixmap & icon); |
@@ -101,3 +103,3 @@ namespace { | |||
101 | m_Pixset = true; | 103 | m_Pixset = true; |
102 | QIconViewItem::setPixmap(icon,recalc,redraw); | 104 | calcRect(text()); |
103 | } | 105 | } |
@@ -106,3 +108,3 @@ namespace { | |||
106 | m_Pixset = true; | 108 | m_Pixset = true; |
107 | QIconViewItem::setPixmap(icon); | 109 | calcRect(text()); |
108 | } | 110 | } |
@@ -127,3 +129,3 @@ namespace { | |||
127 | m_pix = PPixmapCache::self()->cachedImage( m_path, 64, 64 ); | 129 | m_pix = PPixmapCache::self()->cachedImage( m_path, 64, 64 ); |
128 | if (!m_pix && !g_stringPix.contains( m_path )&&!m_Pixset) { | 130 | if (!m_pix && !g_stringPix.contains( m_path )) { |
129 | currentView()->dirLister()->thumbNail( m_path, 64, 64 ); | 131 | currentView()->dirLister()->thumbNail( m_path, 64, 64 ); |
@@ -131,5 +133,2 @@ namespace { | |||
131 | } | 133 | } |
132 | if (m_Pixset) { | ||
133 | return QIconViewItem::pixmap(); | ||
134 | } | ||
135 | return m_pix ? m_pix : _unkPix; | 134 | return m_pix ? m_pix : _unkPix; |
@@ -411,4 +410,8 @@ void PIconView::addFiles( const QStringList& lst) { | |||
411 | _iv = new IconViewItem( m_view, m_path+"/"+(*it), (*it) ); | 410 | _iv = new IconViewItem( m_view, m_path+"/"+(*it), (*it) ); |
412 | if (m_mode==3) _iv->setTextOnly(true); | 411 | if (m_mode==3) { |
413 | if (m_pix) _iv->setPixmap(*m_pix); | 412 | _iv->setTextOnly(true); |
413 | _iv->setPixmap(QPixmap()); | ||
414 | } else { | ||
415 | if (m_pix) _iv->setPixmap(*m_pix); | ||
416 | } | ||
414 | } | 417 | } |
@@ -594,4 +597,5 @@ void PIconView::calculateGrid() { | |||
594 | case 2: | 597 | case 2: |
595 | m_view->setGridX(80); | 598 | m_view->setGridX(50); |
596 | m_view->setGridY(80); | 599 | m_view->setGridY(20); |
600 | PPixmapCache::self()->setMaxImages(40); | ||
597 | break; | 601 | break; |
@@ -600,2 +604,3 @@ void PIconView::calculateGrid() { | |||
600 | m_view->setGridY(8); | 604 | m_view->setGridY(8); |
605 | PPixmapCache::self()->setMaxImages(2); | ||
601 | break; | 606 | break; |
@@ -605,2 +610,3 @@ void PIconView::calculateGrid() { | |||
605 | m_view->setGridY(80); | 610 | m_view->setGridY(80); |
611 | PPixmapCache::self()->setMaxImages(20); | ||
606 | break; | 612 | break; |