diff options
author | Michael BrĂ¼ning <michael.bruning@digia.com> | 2014-10-02 14:34:28 +0200 |
---|---|---|
committer | Michael Bruning <michael.bruning@digia.com> | 2014-10-02 14:57:21 +0200 |
commit | b0d0c6c3d528fb2cd93b30876e324f9ad0e2b6cb (patch) | |
tree | 6b849cff074688a5d3732ffbc2c9189978daf7de /src/core/web_engine_library_info.cpp | |
parent | 062a7748093b13b7d92935d1aa8a00c799a9848c (diff) |
Provide a fallback for the QtWebEngineProcess executable path.
This makes deployment easier and was also what was done in QtWebKit
for the WebKit2 WebProcess executable
Change-Id: I2245c1f3337f19509c08c08c0baf40dc0a964890
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'src/core/web_engine_library_info.cpp')
-rw-r--r-- | src/core/web_engine_library_info.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 6c1cecc3a..c36a204e9 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -96,18 +96,22 @@ QString subProcessPath() { static bool initialized = false; #if defined(OS_WIN) - static QString processPath (location(QLibraryInfo::LibraryExecutablesPath) - % QDir::separator() % QStringLiteral(QTWEBENGINEPROCESS_NAME) % QStringLiteral(".exe")); + static QString processBinary (QStringLiteral(QTWEBENGINEPROCESS_NAME) % QStringLiteral(".exe")); #else - static QString processPath (location(QLibraryInfo::LibraryExecutablesPath) - % QDir::separator() % QStringLiteral(QTWEBENGINEPROCESS_NAME)); + static QString processBinary (QStringLiteral(QTWEBENGINEPROCESS_NAME)); #endif + static QString processPath (location(QLibraryInfo::LibraryExecutablesPath) + % QDir::separator() % processBinary); if (!initialized) { // Allow overriding at runtime for the time being. const QByteArray fromEnv = qgetenv("QTWEBENGINEPROCESS_PATH"); if (!fromEnv.isEmpty()) processPath = QString::fromLatin1(fromEnv); - if (processPath.isEmpty() || !QFileInfo(processPath).exists()) + if (processPath.isEmpty() || !QFileInfo(processPath).exists()) { + qWarning("QtWebEngineProcess not found at location %s. Trying fallback path...", qPrintable(processPath)); + processPath = QCoreApplication::applicationDirPath() % QDir::separator() % processBinary; + } + if (!QFileInfo(processPath).exists()) qFatal("QtWebEngineProcess not found at location %s. Try setting the QTWEBENGINEPROCESS_PATH environment variable.", qPrintable(processPath)); initialized = true; } |