Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/dcc-update-plugin/operation/updateiteminfo.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

Expand Down Expand Up @@ -104,6 +104,11 @@ void UpdateItemInfo::addDetailInfo(DetailInfo detailInfo)
m_detailInfos.append(std::move(detailInfo));
}

void UpdateItemInfo::clearDetailInfos()
{
m_detailInfos.clear();
}

void UpdateItemInfo::setPackages(const QStringList& packages)
{
qCDebug(logDccUpdatePlugin) << "Set packages count:" << packages.size() << "for item:" << m_name;
Expand Down
3 changes: 2 additions & 1 deletion src/dcc-update-plugin/operation/updateiteminfo.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

Expand Down Expand Up @@ -50,6 +50,7 @@ class UpdateItemInfo : public QObject {
QList<DetailInfo> detailInfos() const;
void setDetailInfos(QList<DetailInfo>& detailInfos);
void addDetailInfo(DetailInfo detailInfo);
void clearDetailInfos();

void setUpdateModeEnabled(bool enable) { m_enabled = enable; }
bool isUpdateModeEnabled() const { return m_enabled; }
Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/operation/updateloghelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void UpdateLogHelper::handleSystem(const QJsonArray &log)
void UpdateLogHelper::handleSecurity(const QJsonObject &log)
{
qCDebug(logDccUpdatePlugin) << "Handling security log with" << log.keys().size() << "entries";
m_securityLog.clear();
for (const auto& key : log.keys()) {
const auto& obj = log.value(key).toObject();
if (obj.isEmpty())
Expand Down Expand Up @@ -141,6 +142,8 @@ void UpdateLogHelper::handleSystemItemInfo(UpdateItemInfo *itemInfo) const
return;
}

itemInfo->setCurrentVersion("");
itemInfo->clearDetailInfos();
for (const auto &log : m_systemLog) {
const QString& explain = getLanguageType() == "CN" ? log.cnLog : log.enLog;
itemInfo->setBaseline(log.baseline);
Expand Down Expand Up @@ -170,6 +173,7 @@ void UpdateLogHelper::handleSecurityItemInfo(UpdateItemInfo *itemInfo) const
return;
}

itemInfo->clearDetailInfos();
QMap<VulLevel, int> vulCount;
for (const auto &log : m_securityLog) {
// 写入最近的更新
Expand Down
Loading