Changeset 651 for trunk/src/gui/image/qpixmap.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/image/qpixmap.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 321 321 { 322 322 Q_ASSERT(!data || data->ref >= 1); // Catch if ref-counting changes again 323 if (data && data->is_cached && data->ref == 1) // ref will be decrememnted after destructor returns324 QImagePixmapCleanupHooks::executePixmapDestructionHooks(this);325 323 } 326 324 … … 834 832 return true; 835 833 836 QPixmapData *tmp = QPixmapData::create(0, 0, QPixmapData::PixmapType); 837 if (tmp->fromFile(fileName, format, flags)) { 838 data = tmp; 834 bool ok; 835 836 if (data) { 837 ok = data->fromFile(fileName, format, flags); 838 } else { 839 QScopedPointer<QPixmapData> tmp(QPixmapData::create(0, 0, QPixmapData::PixmapType)); 840 ok = tmp->fromFile(fileName, format, flags); 841 if (ok) 842 data = tmp.take(); 843 } 844 845 if (ok) 839 846 QPixmapCache::insert(key, *this); 840 return true; 841 } 842 delete tmp; 843 return false; 847 848 return ok; 844 849 } 845 850 … … 1019 1024 return 0; 1020 1025 1021 int classKey = data->classId(); 1022 if (classKey >= 1024) 1023 classKey = -(classKey >> 10); 1024 return ((((qint64) classKey) << 56) 1025 | (((qint64) data->serialNumber()) << 32) 1026 | ((qint64) (data->detach_no))); 1026 Q_ASSERT(data); 1027 return data->cacheKey(); 1027 1028 } 1028 1029 … … 1939 1940 1940 1941 if (data->is_cached && data->ref == 1) 1941 QImagePixmapCleanupHooks::executePixmap ModificationHooks(this);1942 QImagePixmapCleanupHooks::executePixmapDataModificationHooks(data.data()); 1942 1943 1943 1944 #if defined(Q_WS_MAC)
Note:
See TracChangeset
for help on using the changeset viewer.