mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-24 15:13:49 +08:00
适配 APM
This commit is contained in:
@@ -34,6 +34,8 @@ QVariant AppListModel::data(const QModelIndex &index, int role) const
|
||||
return map.value("download_url"); // 返回下载 URL
|
||||
case Qt::UserRole + 8: // 忽略状态
|
||||
return map.value("ignored");
|
||||
case Qt::UserRole + 9: // 包来源
|
||||
return map.value("source");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
@@ -55,9 +57,10 @@ void AppListModel::setUpdateData(const QJsonArray &updateInfo)
|
||||
map["size"] = obj["size"].toString();
|
||||
map["download_url"] = obj["download_url"].toString(); // 确保设置下载 URL
|
||||
map["ignored"] = obj["ignored"].toBool(); // 设置忽略状态
|
||||
map["source"] = obj["source"].toString(); // 设置包来源
|
||||
m_data.append(map); // 添加到 QList<QVariantMap>
|
||||
|
||||
qDebug() << "设置到模型的包名:" << map["package"].toString() << "忽略状态:" << map["ignored"].toBool();
|
||||
qDebug() << "设置到模型的包名:" << map["package"].toString() << "忽略状态:" << map["ignored"].toBool() << "来源:" << map["source"].toString();
|
||||
qDebug() << "设置到模型的下载 URL:" << map["download_url"].toString(); // 检查设置的数据
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user