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