diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-02-08 10:42:39 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-02-08 10:42:54 +0100 |
commit | 6ec0428db1d1dda0a74ead838aa799298e7a1306 (patch) | |
tree | e5e68ac246b4120c262914c2a78ba26c18d98a0f /src/core/content_main_delegate_qt.cpp | |
parent | f98de9e4d1631c17f4c3084baa1d1c8f2c69d906 (diff) | |
parent | 9ff8eda0af657ad504318aebea5349b76fbb107a (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: I0c3654ad097809fe10bcc6a15827a0af3006c4e6
Diffstat (limited to 'src/core/content_main_delegate_qt.cpp')
-rw-r--r-- | src/core/content_main_delegate_qt.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 80d4e9827..fa55597d1 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -154,15 +154,29 @@ content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClie #define ICU_UTIL_DATA_SHARED 1 #define ICU_UTIL_DATA_STATIC 2 +static void SafeOverridePathImpl(const char *keyName, int key, const base::FilePath &path) +{ + if (path.empty()) + return; + + // Do not create directories for overridden paths. + if (PathService::OverrideAndCreateIfNeeded(key, path, false, false)) + return; + + qWarning("Path override failed for key %s and path '%s'", keyName, path.value().c_str()); +} + +#define SafeOverridePath(KEY, PATH) SafeOverridePathImpl(#KEY, KEY, PATH) + bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code) { - PathService::Override(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE)); + SafeOverridePath(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE)); #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE - PathService::Override(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA)); + SafeOverridePath(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA)); #endif - PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES)); + SafeOverridePath(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES)); #if defined(ENABLE_SPELLCHECK) - PathService::Override(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES)); + SafeOverridePath(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES)); #endif SetContentClient(new ContentClientQt); return false; |