-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 36 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.h | 1 |
2 files changed, 23 insertions, 14 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index ed9fc9c..4a20648 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -64,6 +64,5 @@ namespace { const QString& name, bool isDir ) - : QIconViewItem( view ), m_path( path ), m_isDir( isDir ), + : QIconViewItem( view, name ), m_path( path ), m_isDir( isDir ), m_noInfo( false ) { - QIconViewItem::setText( name ); if ( isDir && !_dirPix ) @@ -103,3 +102,3 @@ namespace { PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) - : QVBox( wid ), m_cfg( cfg ) + : QVBox( wid ), m_cfg( cfg ), m_updatet( false ) { @@ -310,6 +309,10 @@ void PIconView::slotClicked(QIconViewItem* _it) { void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { - if ( g_stringInf.contains( _path ) ) { IconViewItem* item = g_stringInf[_path]; - /* if set the view shows nonsens! - I dont know how to fix the format of displayed text :(*/ + if (!item ) + return; + + if ( item->intersects(QRect( m_view->contentsX(),m_view->contentsY(), + m_view->contentsWidth(), m_view->contentsHeight() ) ) ) + m_updatet = true; + item->setText( str ); @@ -317,16 +320,17 @@ void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { } -} void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) { - if ( g_stringPix.contains( _path ) ) { IconViewItem* item = g_stringPix[_path]; + if (!item ) + return; - if (pix.width()>0) { + if ( item->intersects(QRect( m_view->contentsX(),m_view->contentsY(), + m_view->contentsWidth(), m_view->contentsHeight() ) ) ) + m_updatet = true; + + if (pix.width()>0) PPixmapCache::self()->insertImage( _path, pix, 64, 64 ); - /* required for a recalculated rectangle. otherwise the view show nonsense! */ - } else { - PPixmapCache::self()->insertImage(_path,Resource::loadPixmap( "UnknownDocument" ),64,64 ); - } + + g_stringPix.remove( _path ); } -} @@ -356,2 +360,3 @@ void PIconView::slotStart() { m_view->viewport()->setUpdatesEnabled( false ); + qWarning( "Sig Start" ); } @@ -359,4 +364,7 @@ void PIconView::slotStart() { void PIconView::slotEnd() { + qWarning( "SLot End" ); + if ( m_updatet ) m_view->arrangeItemsInGrid( ); m_view->viewport()->setUpdatesEnabled( true ); + m_updatet = false; } diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h index 0fba327..7ddb023 100644 --- a/noncore/graphics/opie-eye/gui/iconview.h +++ b/noncore/graphics/opie-eye/gui/iconview.h @@ -76,2 +76,3 @@ private: QString m_path; + bool m_updatet : 1; }; |