Ticket #62964: patch-backport-corelib-109.diff

File patch-backport-corelib-109.diff, 1.8 KB (added by Wowfunhappy (Jonathan), 3 years ago)
  • src/corelib/kernel/qcore_foundation.mm

    diff --git src/corelib/kernel/qcore_foundation.mm src/corelib/kernel/qcore_foundation.mm
    index 56eabc4b8c80d09d5f34eef49ca83da0c05906a3..1f90be956a96ee097937da61e2f8423a56476064 100644
    QTimeZone QTimeZone::fromNSTimeZone(const NSTimeZone *timeZone) 
    488488*/
    489489NSTimeZone *QTimeZone::toNSTimeZone() const
    490490{
    491     return [static_cast<NSTimeZone *>(toCFTimeZone()) autorelease];
     491    return [(NSTimeZone *)(toCFTimeZone()) autorelease];
    492492}
    493493#endif
    494494
  • src/corelib/io/qfilesystemengine_unix.cpp

    diff --git src/corelib/io/qfilesystemengine_unix.cpp src/corelib/io/qfilesystemengine_unix.cpp
    index 7fed54f..f89b21f 100644
    static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e 
    126126
    127127#ifdef Q_OS_MACOS
    128128        // Find if an application other than Finder claims to know how to handle the package
    129         QCFType<CFURLRef> application = LSCopyDefaultApplicationURLForURL(url,
     129#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_10, __IPHONE_NA)
     130        CFURLRef application = nullptr;
     131        if (LSGetApplicationForURL(url, kLSRolesEditor | kLSRolesViewer, NULL, &application) != noErr) {
     132            application = nullptr;
     133        }
     134#else
     135        CFURLRef application = LSCopyDefaultApplicationURLForURL(url,
    130136            kLSRolesEditor | kLSRolesViewer, nullptr);
     137#endif
    131138
    132139        if (application) {
    133140            QCFType<CFBundleRef> bundle = CFBundleCreate(kCFAllocatorDefault, application);
     141            CFRelease(application);
    134142            CFStringRef identifier = CFBundleGetIdentifier(bundle);
    135143            QString applicationId = QString::fromCFString(identifier);
    136144            if (applicationId != QLatin1String("com.apple.finder"))