diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-11 15:31:05 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-11 15:01:49 +0000 |
commit | 12dd6ff845656eb625e2ee3d0e73392bc2c61983 (patch) | |
tree | 97ca4093e2760f49530e1ead86dff177fe26b760 /src/core/web_engine_library_info.cpp | |
parent | 9a8fe6c59a41f7a42ee0cf14e536202bd5be3a64 (diff) |
Move ICU data to resources sub-dir
Also moves the ICU data from the prefix root to the resources subdir.
Change-Id: I1eec6c09a8ff1f87166a9f8a2a010b770198751e
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/core/web_engine_library_info.cpp')
-rw-r--r-- | src/core/web_engine_library_info.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index a3c599208..8ec18c87d 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -202,26 +202,30 @@ QString localesPath() #endif } -QString libraryDataPath() +QString icuDataPath() { #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) return getResourcesPath(frameworkBundle()); #else static bool initialized = false; - static QString potentialDataPath = QLibraryInfo::location(QLibraryInfo::DataPath); + static QString potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); if (!initialized) { initialized = true; - if (!QFileInfo::exists(potentialDataPath)) { - qWarning("Qt WebEngine data directory not found at location %s. Trying application directory...", qPrintable(potentialDataPath)); - potentialDataPath = QCoreApplication::applicationDirPath(); + if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) { + qWarning("Qt WebEngine ICU data not found at %s. Trying parent directory...", qPrintable(potentialResourcesPath)); + potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath); + } + if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) { + qWarning("Qt WebEngine ICU data not found at %s. Trying application directory...", qPrintable(potentialResourcesPath)); + potentialResourcesPath = QCoreApplication::applicationDirPath(); } - if (!QFileInfo::exists(potentialDataPath)) { - qWarning("Qt WebEngine data directory not found at location %s. Trying fallback directory... The application MAY NOT work.", qPrintable(potentialDataPath)); - potentialDataPath = fallbackDir(); + if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) { + qWarning("Qt WebEngine ICU data not found at %s. Trying fallback directory... The application MAY NOT work.", qPrintable(potentialResourcesPath)); + potentialResourcesPath = fallbackDir(); } } - return potentialDataPath; + return potentialResourcesPath; #endif } @@ -278,7 +282,7 @@ base::FilePath WebEngineLibraryInfo::getPath(int key) directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); break; case base::DIR_QT_LIBRARY_DATA: - return toFilePath(libraryDataPath()); + return toFilePath(icuDataPath()); case content::DIR_MEDIA_LIBS: return toFilePath(pluginsPath()); case ui::DIR_LOCALES: |