summaryrefslogtreecommitdiffstats
path: root/src/core/content_main_delegate_qt.cpp
diff options
context:
space:
mode:
authorArvid Nilsson <anilsson@blackberry.com>2013-12-05 16:53:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-09 15:19:13 +0100
commitae600d6b0fdb4bf9b5589df7bac162b1b112c7dd (patch)
tree92192da0088576e04710ccdf7d2a40a033c06129 /src/core/content_main_delegate_qt.cpp
parent3a20190095be8952a64e0510a0724cfbcd75092b (diff)
Introduce WebEngineLibraryInfo for providing paths
This allows us to customize paths on BlackBerry, where QtWebEngine is currently installed to an different location than the rest of Qt5. Change-Id: I7144c992bed9fe4d7543ce0d23ee8cd5f5669dd9 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/content_main_delegate_qt.cpp')
-rw-r--r--src/core/content_main_delegate_qt.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index c967cfd48..c8367fe37 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -45,40 +45,14 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/resource/resource_bundle.h"
-#include <QByteArray>
-#include <QDir>
-#include <QFileInfo>
-#include <QLibraryInfo>
-#include <QStringBuilder>
#include "content_client_qt.h"
-#include "type_conversion.h"
-
-#ifndef QTWEBENGINEPROCESS_NAME
-#error "No name defined for QtWebEngine's process"
-#endif
-static QString subProcessPath() {
- static bool initialized = false;
- static QString processPath (QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath)
- % QDir::separator() % QStringLiteral(QTWEBENGINEPROCESS_NAME));
- if (initialized)
- return processPath;
-
- // 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())
- qFatal("QtWebEngineProcess not found at location %s. Try setting the QTWEBENGINEPROCESS_PATH environment variable.", qPrintable(processPath));
- initialized = true;
- return processPath;
-}
+#include "web_engine_library_info.h"
void ContentMainDelegateQt::PreSandboxStartup()
{
- PathService::Override(base::FILE_EXE, base::FilePath(toFilePathString(subProcessPath())));
- const QString localesPath(QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QStringLiteral("/qtwebengine_locales"));
- PathService::Override(ui::DIR_LOCALES, base::FilePath(toFilePathString(localesPath)));
+ PathService::Override(base::FILE_EXE, WebEngineLibraryInfo::subProcessPath());
+ PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::localesPath());
ui::ResourceBundle::InitSharedInstanceWithLocale(l10n_util::GetApplicationLocale(std::string("en-US")), 0);
}