[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/kphotoalbum
From:       Jesper Pedersen <blackie () blackie ! dk>
Date:       2010-08-16 9:02:21
Message-ID: 20100816090221.2918DAC854 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1164216 by blackie:

Show a broken image icon when a file is not on disk.


 M  +1 -0      ImageManager/ImageLoader.cpp  
 M  +10 -1     ImageManager/Manager.cpp  
 M  +0 -14     ThumbnailView/ThumbnailModel.cpp  


--- trunk/extragear/graphics/kphotoalbum/ImageManager/ImageLoader.cpp \
#1164215:1164216 @@ -154,3 +154,4 @@
 
     return true;
 }
+
--- trunk/extragear/graphics/kphotoalbum/ImageManager/Manager.cpp #1164215:1164216
@@ -17,6 +17,7 @@
 */
 
 #include "Manager.h"
+#include <KIcon>
 #include "ThumbnailCache.h"
 #include "ImageLoader.h"
 #include "ImageManager/ImageClient.h"
@@ -133,8 +134,16 @@
             angle = request->angle();
         }
 
-        if ( loadedOK && request->isThumnailRequest() )
+        if ( request->isThumnailRequest() ) {
+            if ( !request->loadedOK() ) {
+                // PENDING(blackie) This stinks! It looks bad, but I don't have more \
energy to fix it. +                KIcon icon( QString::fromLatin1( "file-broken" ) \
); +                QPixmap pix = icon.pixmap( icon.actualSize( QSize( \
request->width(), request->height() ) ) ); +                image = pix.toImage();
+            }
+
             ImageManager::ThumbnailCache::instance()->insert( request->fileName(), \
image ); +        }
 
         _loadList.removeRequest(request);
         _currentLoading.remove( request );
--- trunk/extragear/graphics/kphotoalbum/ThumbnailView/ThumbnailModel.cpp \
#1164215:1164216 @@ -19,8 +19,6 @@
 #include <QPixmapCache>
 #include <QDebug>
 #include "CellGeometry.h"
-// PENDING(blackie) Use QPointArray
-#include <Q3PointArray>
 #include <QPainter>
 #include "ThumbnailRequest.h"
 #include "DB/ImageDB.h"
@@ -275,19 +273,7 @@
     QPixmap pixmap( size );
     if ( loadedOK && !image.isNull() )
         pixmap = QPixmap::fromImage( image );
-    else if ( !loadedOK )
-        pixmap.fill( widget()->palette().color( QPalette::Dark));
 
-    // PENDING(blackie) this code doesn't work, as the result isn't inserted into \
                any cache.
-    if ( !loadedOK || !DB::ImageInfo::imageOnDisk( fileName ) ) {
-        QPainter p( &pixmap );
-        p.setBrush( widget()->palette().base() );
-        p.setWindow( 0, 0, 100, 100 );
-        Q3PointArray pts;
-        pts.setPoints( 3, 70,-1,  100,-1,  100,30 );
-        p.drawConvexPolygon( pts );
-    }
-
     DB::ResultId id = DB::ImageDB::instance()->ID_FOR_FILE( fileName );
     DB::ImageInfoPtr imageInfo = id.fetchInfo();
     // TODO(hzeller): figure out, why the size is set here. We do an implicit


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic