支持显示本体
This commit is contained in:
parent
6661048433
commit
c4ebe15b79
@ -17,7 +17,7 @@ AboutWindow::AboutWindow(QWidget *parent) :
|
||||
info += "<pre>";
|
||||
info += tr("A kernel manager allows users to install or remove kernels easily.") + "\n\n";
|
||||
info += "<b>" + tr("Warning: You may damage your system unless you know what you will do!") + "</b>\n";
|
||||
info += "Built Time: " + QString(__DATE__) + " " + __TIME__;
|
||||
info += tr("Built Time: ") + QString(__DATE__) + " " + __TIME__;
|
||||
info += "</pre>";
|
||||
info += "<hr/>";
|
||||
info += ProgramInfo::updateInfo();
|
||||
|
@ -1,2 +1,7 @@
|
||||
<h1>更新内容</h1>
|
||||
<p>测试</p>
|
||||
<h1>1.1.0 更新内容</h1>
|
||||
<pre>
|
||||
<b>※1、支持从 apt 源读取内核数据并显示安装
|
||||
※2、支持只显示与当前系统相同架构的内核
|
||||
</b>
|
||||
3、优化表格显示
|
||||
</pre>
|
@ -51,9 +51,15 @@ void KernelInformation::LoadInfo()
|
||||
// 如果已经存在
|
||||
alreadyIndex = indexMap.value(strTemp);
|
||||
QJsonArray pkgArray = array.at(alreadyIndex).toObject().value("PkgName").toArray();
|
||||
QJsonArray archArray = array.at(alreadyIndex).toObject().value("Arch").toArray();
|
||||
pkgArray.append(i);
|
||||
QString pkgArch = info.get_architecture(i);
|
||||
if(!archArray.contains(pkgArch)) {
|
||||
archArray.append(pkgArch);
|
||||
}
|
||||
QJsonObject pkgObject = array.at(alreadyIndex).toObject();
|
||||
pkgObject["PkgName"] = pkgArray;
|
||||
pkgObject["Arch"] = archArray;
|
||||
array.replace(alreadyIndex, pkgObject);
|
||||
continue;
|
||||
}
|
||||
@ -61,21 +67,21 @@ void KernelInformation::LoadInfo()
|
||||
object.insert("Name", strTemp);
|
||||
object.insert("Author", info.get_maintainer(i));
|
||||
object.insert("Des", info.get_description(i));
|
||||
object.insert("Arch", info.get_architecture(i));
|
||||
object.insert("Arch", QJsonArray::fromStringList(QStringList() << info.get_architecture(i)));
|
||||
object.insert("PkgName", QJsonArray::fromStringList(QStringList() << i));
|
||||
indexMap.insert(strTemp, array.count());
|
||||
array.append(object);
|
||||
}
|
||||
// 添加 GXDE Kernel Manager
|
||||
AptPkgInfo kernelManagerinfo = AptPkgInfo("gxde-kernel-manager", AptPkgInfo::PkgSearchOption::Equal);
|
||||
list = info.GetAptPackageList();
|
||||
list = kernelManagerinfo.GetAptPackageList();
|
||||
for(QString i: list) {
|
||||
QJsonObject object;
|
||||
info.SetPkgName(i);
|
||||
object.insert("Name", i);
|
||||
object.insert("Author", info.get_maintainer(i));
|
||||
object.insert("Des", info.get_description(i));
|
||||
object.insert("Arch", info.get_architecture(i));
|
||||
object.insert("Author", kernelManagerinfo.get_maintainer(i));
|
||||
object.insert("Des", kernelManagerinfo.get_description(i));
|
||||
object.insert("Arch", QJsonArray::fromStringList(QStringList() << arch()));
|
||||
object.insert("PkgName", QJsonArray::fromStringList(QStringList() << i));
|
||||
array.append(object);
|
||||
}
|
||||
@ -146,16 +152,17 @@ QStringList KernelInformation::get_system(int value) const
|
||||
|
||||
QStringList KernelInformation::get_arch(int value) const
|
||||
{
|
||||
//QJsonArray list = get_kernelData(value).value("Arch").toArray();
|
||||
/*int count = list.count();
|
||||
QJsonArray list = get_kernelData(value).value("Arch").toArray();
|
||||
int count = list.count();
|
||||
QStringList result;
|
||||
for(int i = 0; i < count; i++) {
|
||||
result << list.at(i).toString();
|
||||
}
|
||||
if(!result.count()) {
|
||||
result << "all";
|
||||
}*/
|
||||
return QStringList() << get_kernelData(value).value("Arch").toString();
|
||||
qDebug() << get_kernelData(value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QString KernelInformation::localKernelName() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user