diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-01-16 18:10:43 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-01-16 18:10:43 +0100 |
commit | e66a1125f2b796fe48aef6c88caf501ee3224c0f (patch) | |
tree | d28115677f56722248bd564e063df96f0f166685 /src/core/web_engine_library_info.cpp | |
parent | 79773ecfcc27b350a3e5ea1149ef51f7cc657b61 (diff) | |
parent | ae657b918ff22da2553dc577c877b03f49cc2bdf (diff) |
Merge 5.4 into 5.4.1
Change-Id: I772c9710d8b01efd385a54e5f642ae2b62702a0e
Diffstat (limited to 'src/core/web_engine_library_info.cpp')
-rw-r--r-- | src/core/web_engine_library_info.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index beae9dd75..2d72dd5a2 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -101,7 +101,12 @@ static inline CFBundleRef frameworkBundle() static QString getPath(CFBundleRef frameworkBundle) { QString path; - if (frameworkBundle) { + // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before. + // We use it for the other OS X versions as well to make sure it works and because + // the directory structure should be the same. + if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) { + path = QDir::cleanPath(qApp->applicationDirPath() % QLatin1String("/../../../..")); + } else if (frameworkBundle) { CFURLRef bundleUrl = CFBundleCopyBundleURL(frameworkBundle); CFStringRef bundlePath = CFURLCopyFileSystemPath(bundleUrl, kCFURLPOSIXPathStyle); path = QString::fromCFString(bundlePath); @@ -114,7 +119,12 @@ static QString getPath(CFBundleRef frameworkBundle) static QString getResourcesPath(CFBundleRef frameworkBundle) { QString path; - if (frameworkBundle) { + // The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before. + // We use it for the other OS X versions as well to make sure it works and because + // the directory structure should be the same. + if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) { + path = getPath(frameworkBundle) % QLatin1String("/Resources"); + } else if (frameworkBundle) { CFURLRef resourcesRelativeUrl = CFBundleCopyResourcesDirectoryURL(frameworkBundle); CFStringRef resourcesRelativePath = CFURLCopyFileSystemPath(resourcesRelativeUrl, kCFURLPOSIXPathStyle); path = getPath(frameworkBundle) % QLatin1Char('/') % QString::fromCFString(resourcesRelativePath); |