支持读取本地内核

This commit is contained in:
2024-04-23 22:08:52 +08:00
parent fd07edc739
commit 9909e472d5
5 changed files with 62 additions and 1 deletions

View File

@@ -55,6 +55,11 @@ QString KernelInformation::get_des(int value) const
return get_kernelData(value).value("Des").toString().replace("\\n", "\n");
}
QString KernelInformation::get_ver(int value) const
{
return get_kernelData(value).value("Ver").toString();
}
QStringList KernelInformation::get_pkgName(int value) const
{
QJsonArray list = get_kernelData(value).value("PkgName").toArray();
@@ -87,3 +92,14 @@ QStringList KernelInformation::get_arch(int value) const
}
return result;
}
QString KernelInformation::localKernelName() const
{
QProcess process;
process.start("uname", QStringList() << "-r");
process.waitForStarted();
process.waitForFinished();
QString result = process.readAllStandardOutput().replace("\n", "").replace(" ", "");
process.close();
return result;
}