diff options
author | Pierre Rossi <pierre.rossi@theqtcompany.com> | 2015-01-16 18:24:17 +0100 |
---|---|---|
committer | Pierre Rossi <pierre.rossi@theqtcompany.com> | 2015-01-16 18:24:17 +0100 |
commit | 0fc1516692fb11f3489bce11a8f0cc15ad8f6b63 (patch) | |
tree | d39aa29c33b87430598fe17751a7d65529792660 /src/core/web_engine_library_info.cpp | |
parent | db2f69bb58ab369e44ea8bb30dcdbe90660578a2 (diff) | |
parent | ae657b918ff22da2553dc577c877b03f49cc2bdf (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/3rdparty
Change-Id: Ied43de29444d4803218e250b096b9c72bc017af7
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 09e2af495..452eee306 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); |