mirror of
https://gitee.com/spark-store-project/spark-web-app-runtime.git
synced 2025-12-15 03:22:05 +08:00
fix: setDescription from cmdline or cfg not working
when aboutDialog is not created yet, ApplicationDescription can't be set Log: merge changes from develop/qt6 branch
This commit is contained in:
@@ -19,23 +19,8 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (!QString(qgetenv("XDG_CURRENT_DESKTOP")).toLower().startsWith("deepin")) {
|
||||
qputenv("XDG_CURRENT_DESKTOP", "Deepin");
|
||||
}
|
||||
|
||||
// 龙芯机器配置,使得 DApplication 能正确加载 QTWEBENGINE
|
||||
qputenv("DTK_FORCE_RASTER_WIDGETS", "FALSE");
|
||||
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-features=UseModernMediaControls");
|
||||
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
|
||||
#ifdef __sw_64__
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
|
||||
#endif
|
||||
|
||||
if (!Dtk::Core::DSysInfo::isDDE()) {
|
||||
#ifndef DSTORE_NO_DXCBs
|
||||
DApplication::loadDXcbPlugin();
|
||||
#endif
|
||||
}
|
||||
|
||||
// 开启 HiDPI 缩放支持
|
||||
DApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
@@ -51,9 +36,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
Application a(fakeArgc, fakeArgv.data());
|
||||
|
||||
// 保存 DTK 主题
|
||||
DApplicationSettings settings;
|
||||
|
||||
// 解析命令行启动参数
|
||||
QCommandLineParser parser;
|
||||
|
||||
@@ -180,10 +162,7 @@ int main(int argc, char *argv[])
|
||||
#if SSL_SERVER
|
||||
quint16 u16sslPort = 0;
|
||||
#endif
|
||||
QString szDefaultDesc = QString("<a href='https://gitee.com/deepin-community-store/spark-web-app-runtime'><span style='font-size:12pt;font-weight:500;'>%1</span></a><br/>"
|
||||
"<span style='font-size:12pt;'>%2</span>")
|
||||
.arg(DEFAULT_TITLE)
|
||||
.arg(QObject::tr("Presented By Spark developers # HadesStudio"));
|
||||
QString szDefaultDesc = QObject::tr("Presented By Spark developers # HadesStudio");
|
||||
|
||||
// 解析可能存在的配置文件
|
||||
QString szCfgFile = DEFAULT_CFG;
|
||||
@@ -258,12 +237,17 @@ int main(int argc, char *argv[])
|
||||
if (parser.isSet(useGPU)) {
|
||||
toUseGPU = parser.value(useGPU).toUInt();
|
||||
}
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
|
||||
if (toUseGPU == true) {
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--ignore-gpu-blocklist --enable-gpu-rasterization --enable-native-gpu-memory-buffers --enable-accelerated-video-decode --disable-web-security");
|
||||
#ifdef __sw_64__
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--ignore-gpu-blocklist --enable-gpu-rasterization --enable-native-gpu-memory-buffers --enable-accelerated-video-decode --disable-web-security --no-sandbox");
|
||||
|
||||
QStringList chromium_flags = {"--disable-web-security"};
|
||||
#if defined __sw_64__ || __loongarch__
|
||||
chromium_flags << "--no-sandbox";
|
||||
#endif
|
||||
if (toUseGPU == true) {
|
||||
chromium_flags << "--ignore-gpu-blocklist"
|
||||
<< "--enable-gpu-rasterization"
|
||||
<< "--enable-native-gpu-memory-buffers"
|
||||
<< "--enable-accelerated-video-decode";
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromium_flags.join(" ").toUtf8());
|
||||
qDebug() << "Setting GPU to True.";
|
||||
}
|
||||
// 初始化 QtWebEngine 深色模式环境变量
|
||||
|
||||
Reference in New Issue
Block a user