diff options
-rw-r--r-- | src/core/web_engine_library_info.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 35b139602..515f763d2 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -163,9 +163,9 @@ QString subProcessPath() #else candidatePaths << QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) % QLatin1Char('/') % processBinary; +#endif candidatePaths << QCoreApplication::applicationDirPath() % QLatin1Char('/') % processBinary; -#endif } Q_FOREACH (const QString &candidate, candidatePaths) { @@ -185,11 +185,13 @@ QString subProcessPath() QString localesPath() { + static bool initialized = false; + static QString potentialLocalesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales"); + getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales"); #else - static bool initialized = false; - static QString potentialLocalesPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales"); + QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales"); +#endif if (!initialized) { initialized = true; @@ -204,7 +206,6 @@ QString localesPath() } return potentialLocalesPath; -#endif } #if BUILDFLAG(ENABLE_SPELLCHECK) @@ -257,11 +258,13 @@ QString dictionariesPath() QString icuDataPath() { + static bool initialized = false; + static QString potentialResourcesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()); + getResourcesPath(frameworkBundle()); #else - static bool initialized = false; - static QString potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); + QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); +#endif if (!initialized) { initialized = true; if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) { @@ -279,16 +282,17 @@ QString icuDataPath() } return potentialResourcesPath; -#endif } QString resourcesDataPath() { + static bool initialized = false; + static QString potentialResourcesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()); + getResourcesPath(frameworkBundle()); #else - static bool initialized = false; - static QString potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); + QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); +#endif if (!initialized) { initialized = true; if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/qtwebengine_resources.pak"))) { @@ -306,7 +310,6 @@ QString resourcesDataPath() } return potentialResourcesPath; -#endif } } // namespace |