架构显示
This commit is contained in:
parent
19cc5cf347
commit
11b1f70ecc
@ -115,3 +115,15 @@ bool KernelInformation::get_installedAlready(int value) const
|
||||
QString pkgName = this->get_pkgName(value).at(0);
|
||||
return QFile::exists("/var/lib/dpkg/info/" + pkgName + ".list");
|
||||
}
|
||||
|
||||
QString KernelInformation::arch() const
|
||||
{
|
||||
QProcess process;
|
||||
process.start("dpkg", QStringList() << "--print-architecture");
|
||||
process.waitForStarted();
|
||||
process.waitForFinished();
|
||||
QString data = process.readAllStandardOutput();
|
||||
data = data.replace("\n", "").replace(" ", "");
|
||||
process.close();
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ public:
|
||||
bool get_installedAlready(int value) const;
|
||||
|
||||
QString localKernelName() const;
|
||||
QString arch() const;
|
||||
|
||||
signals:
|
||||
void loadFinished(QNetworkReply *reply);
|
||||
|
||||
@ -18,7 +18,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
void MainWindow::RefreshKernelList()
|
||||
{
|
||||
ui->m_nowKernel->setText(tr("Kernel: ") + kernelInformation->localKernelName());
|
||||
ui->m_nowKernel->setText(tr("Kernel: ") + kernelInformation->localKernelName() + " " + tr("Arch: ") + kernelInformation->arch());
|
||||
connect(kernelInformation, &KernelInformation::loadFinished, this, [this](){
|
||||
qDebug() << this->kernelInformation->get_listData();
|
||||
RefreshKernelListView(kernelInformation);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user