From 0bc0d13036be410b72f91ad34e2a71821d08a755 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sat, 9 Dec 2023 14:22:11 +0000 Subject: [PATCH] =?UTF-8?q?!251=20=E4=BF=AE=E5=A4=8DARM64=E7=9A=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E9=97=AE=E9=A2=98=20*=20fixup!=20update=20de?= =?UTF-8?q?bian/changelog.=20*=20fix:=20ARM64=E8=AE=BE=E5=A4=87=E6=B8=B2?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 26 ++++++++++------- src/utils/utils.cpp | 16 +++++++++++ src/utils/utils.h | 1 + translations/spark-store_en.ts | 46 +++++++++++++++---------------- translations/spark-store_es.ts | 46 +++++++++++++++---------------- translations/spark-store_fr.ts | 46 +++++++++++++++---------------- translations/spark-store_zh_CN.ts | 46 +++++++++++++++---------------- 7 files changed, 125 insertions(+), 102 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 632ab4f..8b7d6e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -160,7 +160,6 @@ int main(int argc, char *argv[]) */ env += " --disable-gpu"; qputenv("QTWEBENGINE_CHROMIUM_FLAGS", env.trimmed().toUtf8()); - QSurfaceFormat format; format.setRenderableType(QSurfaceFormat::OpenGLES); QSurfaceFormat::setDefaultFormat(format); @@ -172,15 +171,11 @@ int main(int argc, char *argv[]) qputenv("QMLSCENE_DEVICE", "softwarecontext"); DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); } -#endif - - - /** * FIXME: 对于麒麟 CPU 设备,调用 QtWebEngine 会导致客户端崩溃; * 暂时不对 CPU 进行判断,对 wayland 环境下统一处理 */ - if (Utils::isWayland()) { + else { QString env = QString::fromUtf8(qgetenv("QTWEBENGINE_CHROMIUM_FLAGS")); env = env.trimmed(); /** @@ -199,15 +194,26 @@ int main(int argc, char *argv[]) QSurfaceFormat format; format.setRenderableType(QSurfaceFormat::OpenGLES); QSurfaceFormat::setDefaultFormat(format); + } + if (Utils::isPhytium()){ + QString env = QString::fromUtf8(qgetenv("QTWEBENGINE_CHROMIUM_FLAGS")); + env = env.trimmed(); + env += " --single-process"; + qputenv("QTWEBENGINE_CHROMIUM_FLAGS", env.trimmed().toUtf8()); + } +#endif - /** - * NOTE: https://zhuanlan.zhihu.com/p/550285855 - * 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁 - */ + /** + * NOTE: https://zhuanlan.zhihu.com/p/550285855 + * 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁 + */ + if (Utils::isWayland()) { qputenv("QMLSCENE_DEVICE", "softwarecontext"); DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); } + + #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) { // 开启 Hidpi 支持 diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp index e4c7c34..0d37237 100644 --- a/src/utils/utils.cpp +++ b/src/utils/utils.cpp @@ -73,6 +73,22 @@ bool Utils::isWayland() return isWayland; } +bool Utils::isPhytium() +{ + bool isPhytium = false; + QProcess process; + process.start("lscpu"); + process.waitForFinished(); + + + QString output = process.readAllStandardOutput(); + if (output.contains(QLatin1String("Phytium"))) + { + isPhytium = true; + } + + return isPhytium; +} /** * @brief Utils::initConfig 初始化 config.ini 配置文件,去除废弃字段 */ diff --git a/src/utils/utils.h b/src/utils/utils.h index 4351c08..776fd90 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -12,6 +12,7 @@ public: static bool isWayland(); static void initConfig(); static bool isUOS(); + static bool isPhytium(); static QString initUUID(); static void setQPAPlatform(); static void checkUOSDeveloperMode(); diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index b6627e1..5fe4de5 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -126,9 +126,9 @@ - - - + + + Download and Install @@ -180,74 +180,74 @@ - + Developer Mode Disabled - - - + + + Reinstall - + Upgrade - - + + Install - + Installing - - - - + + + + Warning - + The current application does not support deepin, there may be problems - + The current application does not support UOS, there may be problems - + The current application does not support Ubuntu, there may be problems - + The current application does not support current platform, there may be problems - - + + Spark Store - + Uninstall succeeded - + The URL has been copied to the clipboard diff --git a/translations/spark-store_es.ts b/translations/spark-store_es.ts index 63330df..c2b1c62 100644 --- a/translations/spark-store_es.ts +++ b/translations/spark-store_es.ts @@ -126,9 +126,9 @@ - - - + + + Download and Install Descargar e instalar @@ -180,74 +180,74 @@ Haga clic en "abrir" - + Developer Mode Disabled Se ha desactivado el modo desarrollador - - - + + + Reinstall Reinstalación - + Upgrade Actualización - - + + Install Instalación - + Installing Se está instalando - - - - + + + + Warning Aviso - + The current application does not support deepin, there may be problems La aplicación actual no admite deepin, puede haber problemas - + The current application does not support UOS, there may be problems La aplicación actual no admite uos, puede haber problemas - + The current application does not support Ubuntu, there may be problems La aplicación actual no admite ubuntu, puede haber problemas - + The current application does not support current platform, there may be problems La aplicación actual no admite la Plataforma actual, puede haber problemas - - + + Spark Store SPARK Store - + Uninstall succeeded Desinstalación exitosa - + The URL has been copied to the clipboard La URL ha sido copiada al portapapeles diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index dcb4b4b..35d4a9e 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -126,9 +126,9 @@ - - - + + + Download and Install Télécharger et installer @@ -180,74 +180,74 @@ Cliquez sur Ouvrir - + Developer Mode Disabled Mode développeur désactivé - - - + + + Reinstall Réinstaller - + Upgrade Mise à niveau - - + + Install Installation - + Installing Installation en cours - - - - + + + + Warning Avertissement - + The current application does not support deepin, there may be problems L'application actuelle ne supporte pas deepin, il peut y avoir un problème - + The current application does not support UOS, there may be problems L'application actuelle ne prend pas en charge uos, il peut y avoir un problème - + The current application does not support Ubuntu, there may be problems L'application actuelle ne supporte pas Ubuntu, il peut y avoir un problème - + The current application does not support current platform, there may be problems L'application actuelle ne prend pas en charge la plate - forme actuelle, il peut y avoir un problème - - + + Spark Store Le Spark store - + Uninstall succeeded Désinstallation réussie - + The URL has been copied to the clipboard L'URL a été copiée dans le presse - papiers diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 74246e2..3751fc4 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -121,9 +121,9 @@ - - - + + + Download and Install 下载并安装 @@ -180,74 +180,74 @@ 点击跳转 - + Developer Mode Disabled 开发者模式未开启 - - - + + + Reinstall 重新安装 - + Upgrade 升级 - - + + Install 安装 - + Installing 正在安装 - - - - + + + + Warning 警告 - + The current application does not support deepin, there may be problems 当前应用不支持deepin,安装后可能会出现问题 - + The current application does not support UOS, there may be problems 当前应用不支持UOS,安装后可能会出现问题 - + The current application does not support Ubuntu, there may be problems 当前应用不支持Ubuntu,安装后可能会出现问题 - + The current application does not support current platform, there may be problems 当前应用不支持平台,安装后可能会出现问题 - - + + Spark Store 星火应用商店 - + Uninstall succeeded 卸载成功 - + The URL has been copied to the clipboard 链接已复制到剪贴板