qt3support--
authorcoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Wed, 5 Dec 2007 18:33:52 +0000 (18:33 +0000)
committercoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Wed, 5 Dec 2007 18:33:52 +0000 (18:33 +0000)
git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/coolo/qt4-port@42732 e0cc52ee-31ee-0310-8b87-e83c4596d67c

src/YQIconPool.cc
src/YQIconPool.h

index 9b0838e..138c6ad 100644 (file)
@@ -130,7 +130,6 @@ YQIconPool * YQIconPool::iconPool()
 
 YQIconPool::YQIconPool()
 {
-    _iconCache.setAutoDelete( true );
 }
 
 
@@ -144,14 +143,14 @@ YQIconPool::~YQIconPool()
 QPixmap
 YQIconPool::cachedIcon( const char ** xpm_data )
 {
-    QPixmap iconPtr = _iconCache[ xpm_data ];
+    QPixmap iconPtr = _iconCache[ xpm_data ];
 
-    if ( ! iconPtr )
+    if ( iconPtr.isNull() )
     {
-       iconPtr = new QPixmap( xpm_data );
+       iconPtr = QPixmap( xpm_data );
        _iconCache.insert( xpm_data, iconPtr );
     }
-       
-    return *iconPtr;
+
+    return iconPtr;
 }
 
index 04ad6d1..fa639ba 100644 (file)
@@ -21,7 +21,7 @@
 #define YQIconPool_h
 
 #include <qpixmap.h>
-#include <Qt3Support/Q3PtrDict>
+#include <QHash>
 
 class YQIconPool
 {
@@ -109,7 +109,7 @@ private:
     //
 
     static YQIconPool * _iconPool;
-    Q3PtrDict<QPixmap> _iconCache;
+    QHash<const char**,QPixmap>        _iconCache;
 };