Skip to content

Commit

Permalink
fix: 驱动安装后依然展示在可更新列表中
Browse files Browse the repository at this point in the history
修复驱动安装后依然展示在可更新列表中

Log: 修复驱动安装后依然展示在可更新列表中、

Bug: https://pms.uniontech.com/bug-view-227215.html
  • Loading branch information
feeengli authored and deepin-bot[bot] committed Nov 8, 2023
1 parent b28e7a2 commit a1b4f97
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion deepin-devicemanager/src/DriverControl/HttpDriverInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ void HttpDriverInterface::checkDriverInfo(QString strJson, DriverInfo *driverInf
index = i;
}
}
if (index == 0) {
int res = packageInstall(lstDriverInfo[index].strPackages, lstDriverInfo[index].strDebVersion);
if (res > 0) {
res_out = res;
}
}
}

// 找到最优选择后,设置状态,最新、可安装、可更新
Expand Down Expand Up @@ -225,7 +231,19 @@ int HttpDriverInterface::packageInstall(const QString &package_name, const QStri
return 0;
if (infoList[1].contains(version))
return 2;
return 1;
//return 1;

QRegExp rxlen("(\\d+\\S*)");
int pos = rxlen.indexIn(infoList[1]);
QString curVersion;
if (pos > -1) {
curVersion = rxlen.cap(1);
}
// 若当前已安装版本高于推荐版本,不再更新
if (curVersion >= version)
return 2;
else
return 1;
}

QString HttpDriverInterface::getOsBuild()
Expand Down

0 comments on commit a1b4f97

Please sign in to comment.