diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-06-11 21:01:35 (GMT) |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-06-23 14:19:05 (GMT) |
commit | 48fe6dfaf0a52e8a0463fe3fd23015ea63d9d65a (patch) | |
tree | 335822e20cda6614f0cbc5c4fb21c369146a1ad3 /src/gui/kernel/qmime_mac.cpp | |
parent | 9205078f3b2d842735599fd74d6324a4d84bc275 (diff) | |
download | Qt-48fe6dfaf0a52e8a0463fe3fd23015ea63d9d65a.zip Qt-48fe6dfaf0a52e8a0463fe3fd23015ea63d9d65a.tar.gz Qt-48fe6dfaf0a52e8a0463fe3fd23015ea63d9d65a.tar.bz2 |
More culling of Panther Code.
Removed lots of places where we check for Tiger. Now we can assume it.
Reviewed-by: Morten Sørvig
Diffstat (limited to 'src/gui/kernel/qmime_mac.cpp')
-rw-r--r-- | src/gui/kernel/qmime_mac.cpp | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp index ebacc2f..31c66e4 100644 --- a/src/gui/kernel/qmime_mac.cpp +++ b/src/gui/kernel/qmime_mac.cpp @@ -68,11 +68,6 @@ #include "qmap.h" #include <private/qt_mac_p.h> -#ifdef Q_WS_MAC32 -#include <QuickTime/QuickTime.h> -#include "qlibrary.h" -#endif - QT_BEGIN_NAMESPACE extern CGImageRef qt_mac_createCGImageFromQImage(const QImage &img, const QImage **imagePtr = 0); // qpaintengine_mac.cpp @@ -507,6 +502,9 @@ QList<QByteArray> QMacPasteboardMimeHTMLText::convertFromMime(const QString &mim #ifdef Q_WS_MAC32 +#include <QuickTime/QuickTime.h> +#include <qlibrary.h> + typedef ComponentResult (*PtrGraphicsImportSetDataHandle)(GraphicsImportComponent, Handle); typedef ComponentResult (*PtrGraphicsImportCreateCGImage)(GraphicsImportComponent, CGImageRef*, UInt32); typedef ComponentResult (*PtrGraphicsExportSetInputCGImage)(GraphicsExportComponent, CGImageRef); @@ -684,33 +682,11 @@ QVariant QMacPasteboardMimeTiff::convertToMime(const QString &mime, QList<QByteA return ret; const QByteArray &a = data.first(); QCFType<CGImageRef> image; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 - if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) { - QCFType<CFDataRef> data = CFDataCreateWithBytesNoCopy(0, - reinterpret_cast<const UInt8 *>(a.constData()), - a.size(), kCFAllocatorNull); - QCFType<CGImageSourceRef> imageSource = CGImageSourceCreateWithData(data, 0); - image = CGImageSourceCreateImageAtIndex(imageSource, 0, 0); - } else -#endif - { -#ifdef Q_WS_MAC32 - if (resolveMimeQuickTimeSymbols()) { - Handle tiff = NewHandle(a.size()); - memcpy(*tiff, a.constData(), a.size()); - GraphicsImportComponent graphicsImporter; - ComponentResult result = OpenADefaultComponent(GraphicsImporterComponentType, - kQTFileTypeTIFF, &graphicsImporter); - if (!result) - result = ptrGraphicsImportSetDataHandle(graphicsImporter, tiff); - if (!result) - result = ptrGraphicsImportCreateCGImage(graphicsImporter, &image, - kGraphicsImportCreateCGImageUsingCurrentSettings); - CloseComponent(graphicsImporter); - DisposeHandle(tiff); - } -#endif - } + QCFType<CFDataRef> tiffData = CFDataCreateWithBytesNoCopy(0, + reinterpret_cast<const UInt8 *>(a.constData()), + a.size(), kCFAllocatorNull); + QCFType<CGImageSourceRef> imageSource = CGImageSourceCreateWithData(tiffData, 0); + image = CGImageSourceCreateImageAtIndex(imageSource, 0, 0); if (image != 0) ret = QVariant(QPixmap::fromMacCGImageRef(image).toImage()); |