SVN commit 1210521 by pino: Q3IntDict -> QHash M +9 -10 desktop.cpp M +3 -4 desktop.h --- trunk/extragear/utils/kpager/desktop.cpp #1210520:1210521 @@ -64,7 +64,6 @@ setAcceptDrops(true); setAttribute(Qt::WA_NoSystemBackground, true); - if (m_desk==1) Desktop::m_windowPixmaps.setAutoDelete(true); KSharedConfig::Ptr cfg = KGlobal::config(); KConfigGroup grp(cfg,"KPager"); m_transparentMode=static_cast @@ -560,9 +559,9 @@ rSmall = QRect( r.x() * width() / dw, 2 + r.y() * height() / dh, r.width() * width() / dw, r.height() * height() / dh ); - QPixmap *pixmap=m_windowPixmaps[info->win()]; + QPixmap pixmap = m_windowPixmaps.value(info->win()); bool isDirty=m_windowPixmapsDirty[info->win()]; - if ( !pixmap || isDirty || m_grabWindows ) + if ( !pixmap.isNull() || isDirty || m_grabWindows ) { if ( isCurrent() ) { @@ -581,15 +580,15 @@ nWd = rSmall.width(); nHg = rSmall.height(); } - pixmap=new QPixmap(fastScalePixmap(tmp, nWd, nHg)); - m_windowPixmaps.replace(info->win(),pixmap); + pixmap = fastScalePixmap(tmp, nWd, nHg); + m_windowPixmaps[info->win()] = pixmap; m_windowPixmapsDirty.remove(info->win()); m_windowPixmapsDirty.insert(info->win(),false); } } // It was impossible to get the pixmap, let's fallback to the icon mode. - if ( !pixmap || pixmap->isNull() ) + if ( pixmap.isNull() ) { paintWindowIcon(p, info, onDesktop); return; @@ -600,14 +599,14 @@ if ( !onDesktop ) rSmall.moveTopLeft(QPoint(0,0)); - if (rSmall.width() != pixmap->width() || rSmall.height() != pixmap->height()) + if (rSmall.width() != pixmap.width() || rSmall.height() != pixmap.height()) { - QPixmap pixmapSmall(fastScalePixmap(*pixmap,rSmall.width(),rSmall.height())); + QPixmap pixmapSmall(fastScalePixmap(pixmap,rSmall.width(),rSmall.height())); p.drawPixmap( rSmall.topLeft(), pixmapSmall ); } else { - p.drawPixmap( rSmall.topLeft(), *pixmap); + p.drawPixmap( rSmall.topLeft(), pixmap); } } @@ -671,7 +670,7 @@ QPixmap *Desktop::m_bgCommonSmallPixmap=0L; bool Desktop::m_isCommon=false; -Q3IntDict Desktop::m_windowPixmaps; +QHash Desktop::m_windowPixmaps; QMap Desktop::m_windowPixmapsDirty; // Default Configuration ------------------------------------------------- --- trunk/extragear/utils/kpager/desktop.h #1210520:1210521 @@ -26,14 +26,13 @@ #define __DESKTOP_H #include -#include -//Added by qt3to4: #include #include #include #include #include #include +#include #include class KSharedPixmap; @@ -77,7 +76,7 @@ void convertRectS2P(QRect &r); void convertCoordP2S(int &x, int &y); - static void removeCachedPixmap(int nWin) { m_windowPixmaps.remove(nWin); } + static void removeCachedPixmap(WId nWin) { m_windowPixmaps.remove(nWin); } QSize sizeHint() const; @@ -112,7 +111,7 @@ QPixmap *m_bgSmallPixmap; static QPixmap *m_bgCommonSmallPixmap; static bool m_isCommon; - static Q3IntDict m_windowPixmaps; + static QHash m_windowPixmaps; static QMap m_windowPixmapsDirty; WindowTransparentMode m_transparentMode;