diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-05-16 13:59:25 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-05-16 12:57:31 +0000 |
commit | f9dbcac181bf71467761dff681223c1f03aaa8a6 (patch) | |
tree | 8dff94b7747e2ce8011fc6f4f04ba1cc2a1aec94 /src/tools | |
parent | f14e041b3847b1fb87dc4daf464462f67bc0c778 (diff) |
Fix qwebengine_convert_dict to work with macOS framework build
The ICU data file in a macOS framework build is located inside the
QtWebEngineCore.framework/Resources directory. The dictionary
conversion tool looked for the ICU data file only in the installed
Qt location directory, which is incorrect, thus leading to a conversion
failure.
The fix is to check for the data file in the QtWebEngineCore framework
directory.
Task-number: QTBUG-60707
Change-Id: Ic2325e2b5a5db4e7cbcea3bed92755d5f8b92f95
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qwebengine_convert_dict/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/qwebengine_convert_dict/main.cpp b/src/tools/qwebengine_convert_dict/main.cpp index 61e26c4a3..a86f868b3 100644 --- a/src/tools/qwebengine_convert_dict/main.cpp +++ b/src/tools/qwebengine_convert_dict/main.cpp @@ -107,6 +107,14 @@ inline bool VerifyWords(const convert_dict::DicReader::WordList& org_words, return true; } +#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) +QString frameworkIcuDataPath() +{ + return QLibraryInfo::location(QLibraryInfo::LibrariesPath) + + QStringLiteral("/QtWebEngineCore.framework/Resources/"); +} +#endif + int main(int argc, char *argv[]) { QTextStream out(stdout); @@ -132,6 +140,14 @@ int main(int argc, char *argv[]) icuDataDir = icuPossibleEnvDataDir; icuDataDirFound = true; } +#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) + // In a macOS Qt framework build, the resources are inside the QtWebEngineCore framework + // Resources directory, rather than in the Qt install location. + else if (QFileInfo::exists(frameworkIcuDataPath())) { + icuDataDir = frameworkIcuDataPath(); + icuDataDirFound = true; + } +#endif // Try to find the ICU data directory in the installed Qt location. else if (QFileInfo::exists(icuDataDir)) { icuDataDirFound = true; |