mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 21:02:04 +08:00
chore:检测config.ini是否对webengine沙箱有要求
This commit is contained in:
@@ -261,3 +261,18 @@ QJsonObject Utils::parseFeatureJsonFile()
|
|||||||
|
|
||||||
return jsonDoc.object();
|
return jsonDoc.object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Utils::shouldDisableWebEngineSandbox 检查是否应关闭webengine沙箱
|
||||||
|
* @return bool true: 配置文件中设置了关闭沙箱 false: 未设置或设置为false
|
||||||
|
*/
|
||||||
|
bool Utils::shouldDisableWebEngineSandbox()
|
||||||
|
{
|
||||||
|
// WARNING: 请在 组织名称 和 应用程序名称 初始化完成后调用
|
||||||
|
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||||
|
|
||||||
|
// 检查配置文件中[webengine]部分的noSandbox配置项
|
||||||
|
// 如果配置存在且值为true,则返回true;否则返回false
|
||||||
|
qDebug()<<"shaxiang"<<config.value("webengine/noSandbox", false).toBool();
|
||||||
|
return config.value("webengine/noSandbox", false).toBool();
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ public:
|
|||||||
static void setQPAPlatform();
|
static void setQPAPlatform();
|
||||||
static void checkUOSDeveloperMode();
|
static void checkUOSDeveloperMode();
|
||||||
static QJsonObject parseFeatureJsonFile();
|
static QJsonObject parseFeatureJsonFile();
|
||||||
|
static bool shouldDisableWebEngineSandbox(); // 新增函数声明
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UTILS_H
|
#endif // UTILS_H
|
||||||
Reference in New Issue
Block a user