完成获取应用列表、获取内置app列表
This commit is contained in:
@ -585,10 +585,13 @@ bool SoftwareRequest::sendRequest(QHash<QString, Record> *records)
|
||||
QJsonArray array;
|
||||
for(auto record : *records)
|
||||
{
|
||||
array.append(record.orig_name);
|
||||
QJsonObject object;
|
||||
object.insert("orig_name", record.orig_name);
|
||||
object.insert("path", record.path);
|
||||
array.append(object);
|
||||
}
|
||||
QJsonObject obj_root = qJsonDocument.object();
|
||||
obj_root.insert("orig_names", array);
|
||||
obj_root.insert("software", array);
|
||||
qJsonDocument.setObject(obj_root);
|
||||
QString url = SOFTWARE_URL;
|
||||
requestInfo.setUrl(url);
|
||||
@ -626,9 +629,8 @@ bool SoftwareRequest::sendRequest(QHash<QString, Record> *records)
|
||||
QJsonObject object = value.toObject();
|
||||
QString orig_name = object.value("orig_name").toString();
|
||||
(*records)[orig_name].logo = object.value("img").toString();
|
||||
(*records)[orig_name].op = object.value("op").toString();
|
||||
(*records)[orig_name].func = object.value("func").toString();
|
||||
(*records)[orig_name].url = object.value("url").toString();
|
||||
(*records)[orig_name].path = object.value("path").toString();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user