summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye') (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp36
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.h1
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 {
64 const QString& name, bool isDir ) 64 const QString& name, bool isDir )
65 : QIconViewItem( view ), m_path( path ), m_isDir( isDir ), 65 : QIconViewItem( view, name ), m_path( path ), m_isDir( isDir ),
66 m_noInfo( false ) 66 m_noInfo( false )
67 { 67 {
68 QIconViewItem::setText( name );
69 if ( isDir && !_dirPix ) 68 if ( isDir && !_dirPix )
@@ -103,3 +102,3 @@ namespace {
103PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) 102PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
104 : QVBox( wid ), m_cfg( cfg ) 103 : QVBox( wid ), m_cfg( cfg ), m_updatet( false )
105{ 104{
@@ -310,6 +309,10 @@ void PIconView::slotClicked(QIconViewItem* _it) {
310void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { 309void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
311 if ( g_stringInf.contains( _path ) ) {
312 IconViewItem* item = g_stringInf[_path]; 310 IconViewItem* item = g_stringInf[_path];
313 /* if set the view shows nonsens! 311 if (!item )
314 I dont know how to fix the format of displayed text :(*/ 312 return;
313
314 if ( item->intersects(QRect( m_view->contentsX(),m_view->contentsY(),
315 m_view->contentsWidth(), m_view->contentsHeight() ) ) )
316 m_updatet = true;
317
315 item->setText( str ); 318 item->setText( str );
@@ -317,16 +320,17 @@ void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
317 } 320 }
318}
319void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) { 321void PIconView::slotThumbNail(const QString& _path, const QPixmap &pix) {
320 if ( g_stringPix.contains( _path ) ) {
321 IconViewItem* item = g_stringPix[_path]; 322 IconViewItem* item = g_stringPix[_path];
323 if (!item )
324 return;
322 325
323 if (pix.width()>0) { 326 if ( item->intersects(QRect( m_view->contentsX(),m_view->contentsY(),
327 m_view->contentsWidth(), m_view->contentsHeight() ) ) )
328 m_updatet = true;
329
330 if (pix.width()>0)
324 PPixmapCache::self()->insertImage( _path, pix, 64, 64 ); 331 PPixmapCache::self()->insertImage( _path, pix, 64, 64 );
325 /* required for a recalculated rectangle. otherwise the view show nonsense! */ 332
326 } else { 333
327 PPixmapCache::self()->insertImage(_path,Resource::loadPixmap( "UnknownDocument" ),64,64 );
328 }
329 g_stringPix.remove( _path ); 334 g_stringPix.remove( _path );
330 } 335 }
331}
332 336
@@ -356,2 +360,3 @@ void PIconView::slotStart() {
356 m_view->viewport()->setUpdatesEnabled( false ); 360 m_view->viewport()->setUpdatesEnabled( false );
361 qWarning( "Sig Start" );
357} 362}
@@ -359,4 +364,7 @@ void PIconView::slotStart() {
359void PIconView::slotEnd() { 364void PIconView::slotEnd() {
365 qWarning( "SLot End" );
366 if ( m_updatet )
360 m_view->arrangeItemsInGrid( ); 367 m_view->arrangeItemsInGrid( );
361 m_view->viewport()->setUpdatesEnabled( true ); 368 m_view->viewport()->setUpdatesEnabled( true );
369 m_updatet = false;
362} 370}
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:
76 QString m_path; 76 QString m_path;
77 bool m_updatet : 1;
77}; 78};