<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[153936] trunk/dports/aqua/qt4-mac</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/153936">153936</a></dd>
<dt>Author</dt> <dd>mcalhoun@macports.org</dd>
<dt>Date</dt> <dd>2016-10-16 09:28:08 -0700 (Sun, 16 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>qt4-mac: Remove code which requires QTKit; fixes #52332
QTKit no longer exists as of macOS 10.12
The code comments indicate it is only needed prior to 10.6</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsaquaqt4macPortfile">trunk/dports/aqua/qt4-mac/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsaquaqt4macfilespatchsrc_gui_kernel_qmime_maccppdiff">trunk/dports/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsaquaqt4macPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/aqua/qt4-mac/Portfile (153935 => 153936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/aqua/qt4-mac/Portfile       2016-10-16 15:58:14 UTC (rev 153935)
+++ trunk/dports/aqua/qt4-mac/Portfile  2016-10-16 16:28:08 UTC (rev 153936)
</span><span class="lines">@@ -267,6 +267,15 @@
</span><span class="cx"> patchfiles-append   \
</span><span class="cx">     patch-src_gui_dialogs_qfiledialog_mac.mm.diff
</span><span class="cx"> 
</span><ins>+# (27) QTKit no longer exists as of macOS 10.12 (Sierra)
+# https://trac.macports.org/ticket/52332
+
+platform darwin {
+    if {${MINOR} >= 12} {
+        patchfiles-append patch-src_gui_kernel_qmime_mac.cpp.diff
+    }
+}
+
</ins><span class="cx"> # error out if trying to build on a new OSX version (> 10.12).
</span><span class="cx"> 
</span><span class="cx"> platform darwin {
</span></span></pre></div>
<a id="trunkdportsaquaqt4macfilespatchsrc_gui_kernel_qmime_maccppdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff (0 => 153936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff                          (rev 0)
+++ trunk/dports/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff     2016-10-16 16:28:08 UTC (rev 153936)
</span><span class="lines">@@ -0,0 +1,207 @@
</span><ins>+--- .//src/gui/kernel/qmime_mac.cpp.orig       2015-05-07 07:14:43.000000000 -0700
++++ .//src/gui/kernel/qmime_mac.cpp    2016-10-10 04:12:17.000000000 -0700
+@@ -68,12 +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
+@@ -501,147 +495,6 @@
+     return ret;
+ }

+-
+-#ifdef Q_WS_MAC32
+-
+-// This can be removed once 10.6 is the minimum (or we have to require 64-bit) whichever comes first.
+-
+-typedef ComponentResult (*PtrGraphicsImportSetDataHandle)(GraphicsImportComponent, Handle);
+-typedef ComponentResult (*PtrGraphicsImportCreateCGImage)(GraphicsImportComponent, CGImageRef*, UInt32);
+-typedef ComponentResult (*PtrGraphicsExportSetInputCGImage)(GraphicsExportComponent, CGImageRef);
+-typedef ComponentResult (*PtrGraphicsExportSetOutputHandle)(GraphicsExportComponent, Handle);
+-typedef ComponentResult (*PtrGraphicsExportDoExport)(GraphicsExportComponent, unsigned long *);
+-
+-static PtrGraphicsImportSetDataHandle ptrGraphicsImportSetDataHandle = 0;
+-static PtrGraphicsImportCreateCGImage ptrGraphicsImportCreateCGImage = 0;
+-static PtrGraphicsExportSetInputCGImage ptrGraphicsExportSetInputCGImage = 0;
+-static PtrGraphicsExportSetOutputHandle ptrGraphicsExportSetOutputHandle = 0;
+-static PtrGraphicsExportDoExport ptrGraphicsExportDoExport = 0;
+-
+-static bool resolveMimeQuickTimeSymbols()
+-{
+-    static bool triedResolve = false;
+-    if (!triedResolve) {
+-        QLibrary library(QLatin1String("/System/Library/Frameworks/QuickTime.framework/QuickTime"));
+-        ptrGraphicsImportSetDataHandle = reinterpret_cast<PtrGraphicsImportSetDataHandle>(library.resolve("GraphicsImportSetDataHandle"));
+-        ptrGraphicsImportCreateCGImage = reinterpret_cast<PtrGraphicsImportCreateCGImage>(library.resolve("GraphicsImportCreateCGImage"));
+-        ptrGraphicsExportSetInputCGImage = reinterpret_cast<PtrGraphicsExportSetInputCGImage>(library.resolve("GraphicsExportSetInputCGImage"));
+-        ptrGraphicsExportSetOutputHandle = reinterpret_cast<PtrGraphicsExportSetOutputHandle>(library.resolve("GraphicsExportSetOutputHandle"));
+-        ptrGraphicsExportDoExport = reinterpret_cast<PtrGraphicsExportDoExport>(library.resolve("GraphicsExportDoExport"));
+-        triedResolve = true;
+-    }
+-
+-    return ptrGraphicsImportSetDataHandle != 0
+-           && ptrGraphicsImportCreateCGImage != 0 && ptrGraphicsExportSetInputCGImage != 0
+-           && ptrGraphicsExportSetOutputHandle != 0 && ptrGraphicsExportDoExport != 0;
+-}
+-
+-class QMacPasteboardMimePict : public QMacPasteboardMime {
+-public:
+-    QMacPasteboardMimePict() : QMacPasteboardMime(MIME_ALL) { }
+-    QString convertorName();
+-
+-    QString flavorFor(const QString &mime);
+-    QString mimeFor(QString flav);
+-    bool canConvert(const QString &mime, QString flav);
+-    QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav);
+-    QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav);
+-};
+-
+-QString QMacPasteboardMimePict::convertorName()
+-{
+-    return QLatin1String("Pict");
+-}
+-
+-QString QMacPasteboardMimePict::flavorFor(const QString &mime)
+-{
+-    if(mime.startsWith(QLatin1String("application/x-qt-image")))
+-        return QLatin1String("com.apple.pict");
+-    return QString();
+-}
+-
+-QString QMacPasteboardMimePict::mimeFor(QString flav)
+-{
+-    if(flav == QLatin1String("com.apple.pict"))
+-        return QLatin1String("application/x-qt-image");
+-    return QString();
+-}
+-
+-bool QMacPasteboardMimePict::canConvert(const QString &mime, QString flav)
+-{
+-    return flav == QLatin1String("com.apple.pict")
+-            && mime == QLatin1String("application/x-qt-image");
+-}
+-
+-
+-QVariant QMacPasteboardMimePict::convertToMime(const QString &mime, QList<QByteArray> data, QString flav)
+-{
+-    if(data.count() > 1)
+-        qWarning("QMacPasteboardMimePict: Cannot handle multiple member data");
+-    QVariant ret;
+-    if (!resolveMimeQuickTimeSymbols())
+-        return ret;
+-
+-    if(!canConvert(mime, flav))
+-        return ret;
+-    const QByteArray &a = data.first();
+-
+-    // This function expects the 512 header (just to skip it, so create the extra space for it).
+-    Handle pic = NewHandle(a.size() + 512);
+-    memcpy(*pic + 512, a.constData(), a.size());
+-
+-    GraphicsImportComponent graphicsImporter;
+-    ComponentResult result = OpenADefaultComponent(GraphicsImporterComponentType,
+-                                                   kQTFileTypePicture, &graphicsImporter);
+-    QCFType<CGImageRef> cgImage;
+-    if (!result)
+-        result = ptrGraphicsImportSetDataHandle(graphicsImporter, pic);
+-    if (!result)
+-        result = ptrGraphicsImportCreateCGImage(graphicsImporter, &cgImage,
+-                                             kGraphicsImportCreateCGImageUsingCurrentSettings);
+-    if (!result)
+-        ret = QVariant(QPixmap::fromMacCGImageRef(cgImage).toImage());
+-    CloseComponent(graphicsImporter);
+-    DisposeHandle(pic);
+-    return ret;
+-}
+-
+-QList<QByteArray> QMacPasteboardMimePict::convertFromMime(const QString &mime, QVariant variant,
+-                                                          QString flav)
+-{
+-    QList<QByteArray> ret;
+-    if (!resolveMimeQuickTimeSymbols())
+-        return ret;
+-
+-    if (!canConvert(mime, flav))
+-        return ret;
+-    QCFType<CGImageRef> cgimage = qt_mac_createCGImageFromQImage(qvariant_cast<QImage>(variant));
+-    Handle pic = NewHandle(0);
+-    GraphicsExportComponent graphicsExporter;
+-    ComponentResult result = OpenADefaultComponent(GraphicsExporterComponentType,
+-                                                   kQTFileTypePicture, &graphicsExporter);
+-    if (!result) {
+-        unsigned long sizeWritten;
+-        result = ptrGraphicsExportSetInputCGImage(graphicsExporter, cgimage);
+-        if (!result)
+-            result = ptrGraphicsExportSetOutputHandle(graphicsExporter, pic);
+-        if (!result)
+-            result = ptrGraphicsExportDoExport(graphicsExporter, &sizeWritten);
+-
+-        CloseComponent(graphicsExporter);
+-    }
+-
+-    int size = GetHandleSize((Handle)pic);
+-    // Skip the Picture File header (512 bytes) and feed the raw data
+-    QByteArray ar(reinterpret_cast<char *>(*pic + 512), size - 512);
+-    ret.append(ar);
+-    DisposeHandle(pic);
+-    return ret;
+-}
+-
+-
+-#endif //Q_WS_MAC32
+-
+ class QMacPasteboardMimeTiff : public QMacPasteboardMime {
+ public:
+     QMacPasteboardMimeTiff() : QMacPasteboardMime(MIME_ALL) { }
+@@ -734,30 +587,7 @@
+         ret.append(ar);
+     } else
+ #endif
+-    {
+-#ifdef Q_WS_MAC32
+-        Handle tiff = NewHandle(0);
+-        if (resolveMimeQuickTimeSymbols()) {
+-            GraphicsExportComponent graphicsExporter;
+-            ComponentResult result = OpenADefaultComponent(GraphicsExporterComponentType,
+-                                                           kQTFileTypeTIFF, &graphicsExporter);
+-            if (!result) {
+-                unsigned long sizeWritten;
+-                result = ptrGraphicsExportSetInputCGImage(graphicsExporter, cgimage);
+-                if (!result)
+-                    result = ptrGraphicsExportSetOutputHandle(graphicsExporter, tiff);
+-                if (!result)
+-                    result = ptrGraphicsExportDoExport(graphicsExporter, &sizeWritten);

+-                CloseComponent(graphicsExporter);
+-            }
+-        }
+-        int size = GetHandleSize((Handle)tiff);
+-        QByteArray ar(reinterpret_cast<char *>(*tiff), size);
+-        ret.append(ar);
+-        DisposeHandle(tiff);
+-#endif
+-    }
+     return ret;
+ }

+@@ -1158,12 +988,6 @@

+         //standard types that we wrap
+         new QMacPasteboardMimeTiff;
+-#ifdef Q_WS_MAC32
+-        // 10.6 does automatic synthesis to and from PICT to standard image types (like TIFF),
+-        // so don't bother doing it ourselves, especially since it's not available in 64-bit.
+-        if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_6)
+-            new QMacPasteboardMimePict;
+-#endif
+         new QMacPasteboardMimeUnicodeText;
+         new QMacPasteboardMimePlainText;
+         new QMacPasteboardMimeHTMLText;
</ins></span></pre>
</div>
</div>

</body>
</html>