Changeset 769 for trunk/src/gui/image/qimagepixmapcleanuphooks.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/image/qimagepixmapcleanuphooks.cpp
r651 r769 97 97 { 98 98 QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); 99 // the global destructor for the pixmap and image hooks might have 100 // been called already if the app is "leaking" global 101 // pixmaps/images 102 if (!h) 103 return; 99 104 for (int i = 0; i < h->pixmapModificationHooks.count(); ++i) 100 105 h->pixmapModificationHooks[i](pmd); … … 107 112 { 108 113 QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); 114 // the global destructor for the pixmap and image hooks might have 115 // been called already if the app is "leaking" global 116 // pixmaps/images 117 if (!h) 118 return; 109 119 for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i) 110 120 h->pixmapDestructionHooks[i](pmd); … … 123 133 } 124 134 125 void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap)126 {127 enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data());128 }129 135 130 136 void QImagePixmapCleanupHooks::enableCleanupHooks(QPixmapData *pixmapData) 131 137 { 132 138 pixmapData->is_cached = true; 139 } 140 141 void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) 142 { 143 enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); 133 144 } 134 145 … … 138 149 } 139 150 151 bool QImagePixmapCleanupHooks::isImageCached(const QImage &image) 152 { 153 return const_cast<QImage &>(image).data_ptr()->is_cached; 154 } 155 156 bool QImagePixmapCleanupHooks::isPixmapCached(const QPixmap &pixmap) 157 { 158 return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached; 159 } 160 161 162 140 163 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.