Commit c3ed5b34f7baef53bf4f6234fb99d52694433f93
1 parent
c5a6cbac
Exists in
master
Correções para rodar no linux e na coleta de hardware linux.
Showing
3 changed files
with
9 additions
and
3 deletions
Show diff stats
src/cacic_hardware.cpp
... | ... | @@ -11,7 +11,7 @@ void cacic_hardware::iniciaColeta() |
11 | 11 | OperatingSystem operatingSystem; |
12 | 12 | |
13 | 13 | // se o shell retorna erro ao tentar utilizar o lshw ou o dmidecode, instala o mesmo |
14 | - if( console("lshw").contains("/bin/sh") ){ qDebug() << "lshw nao instalado."; | |
14 | + if( console("lshw").contains("/bin/sh:") ){ qDebug() << "lshw nao instalado."; | |
15 | 15 | if(operatingSystem.getIdOs() == OperatingSystem::LINUX_ARCH) |
16 | 16 | console("pacman -S --needed --noconfirm lshw"); |
17 | 17 | else if(operatingSystem.getIdOs() == OperatingSystem::LINUX_DEBIAN || |
... | ... | @@ -400,15 +400,17 @@ void cacic_hardware::coletaLinuxMotherboard(QJsonObject &hardware) |
400 | 400 | } |
401 | 401 | |
402 | 402 | consoleOutput= console("dmidecode -t 10").split("\n"); |
403 | + | |
404 | + QVariantList onboardCapabilities; | |
403 | 405 | foreach(QString line, consoleOutput){ |
404 | - QJsonArray onboardCapabilities; | |
405 | 406 | |
406 | 407 | if(line.contains("Type:") ) |
407 | 408 | onboardCapabilities.append( QJsonValue::fromVariant( QString(line.split(":")[1].mid(1)) ) ); |
408 | 409 | |
409 | - motherboard["onboard_capabilities"] = onboardCapabilities; | |
410 | 410 | } |
411 | 411 | |
412 | + motherboard["onboard_capabilities"] = QJsonValue::fromVariant(onboardCapabilities); | |
413 | + | |
412 | 414 | hardware["motherboard"] = motherboard; |
413 | 415 | } |
414 | 416 | ... | ... |
src/wmi.cpp