summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary_unix.cpp
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2010-06-11 13:06:38 +0200
committerZeno Albisser <zeno.albisser@nokia.com>2010-06-11 14:48:53 +0200
commit999caa5d5418cde3bf0cb531fe2c1e15da537dd9 (patch)
treeb17fb765b6a9cf8a2e21c1930dd59b18f20c9739 /src/corelib/plugin/qlibrary_unix.cpp
parent5d82a49aeba2a4b2608ea114702920ced97faddf (diff)
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/qlibrary_unix.cpp')
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index e8f0eaec40..9ad1c01f49 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