summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_library_info.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-16 18:24:17 +0100
committerPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-16 18:24:17 +0100
commit0fc1516692fb11f3489bce11a8f0cc15ad8f6b63 (patch)
treed39aa29c33b87430598fe17751a7d65529792660 /src/core/web_engine_library_info.cpp
parentdb2f69bb58ab369e44ea8bb30dcdbe90660578a2 (diff)
parentae657b918ff22da2553dc577c877b03f49cc2bdf (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.cpp14
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);