diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2010-06-11 11:06:38 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:24:50 (GMT) |
commit | 36974b766ea4dac594680b246dd22311c30f9adb (patch) | |
tree | be336613c7952e6a04e7dcdef928e228ef7cfb85 /src/corelib/plugin | |
parent | c242e79b3b03668ba347b9bcf833f22f4386f08f (diff) | |
download | Qt-36974b766ea4dac594680b246dd22311c30f9adb.zip Qt-36974b766ea4dac594680b246dd22311c30f9adb.tar.gz Qt-36974b766ea4dac594680b246dd22311c30f9adb.tar.bz2 |
Adjust handling of library .bundle on Mac
QLibrary::isLibrary() returns true for files with the sufix .bundle.
But we did not use to determine the proper library within the bundle
in that case.
Reviewed-by: Fabien Freling
Task-number: QTBUG-11217
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index e9b3628..3f73989 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -223,11 +223,15 @@ bool QLibraryPrivate::load_sys() #ifdef Q_OS_MAC if (!pHnd) { - if (CFBundleRef bundle = CFBundleGetBundleWithIdentifier(QCFString(fileName))) { + QByteArray utf8Bundle = fileName.toUtf8(); + QCFType<CFURLRef> bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL, reinterpret_cast<const UInt8*>(utf8Bundle.data()), utf8Bundle.length(), true); + QCFType<CFBundleRef> bundle = CFBundleCreate(NULL, bundleUrl); + if(bundle) { QCFType<CFURLRef> url = CFBundleCopyExecutableURL(bundle); - QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - pHnd = dlopen(QFile::encodeName(str), dlFlags); - attempt = str; + char executableFile[FILENAME_MAX]; + CFURLGetFileSystemRepresentation(url, true, reinterpret_cast<UInt8*>(executableFile), FILENAME_MAX); + attempt = QString::fromUtf8(executableFile); + pHnd = dlopen(QFile::encodeName(attempt), dlFlags); } } #endif |