diff --git a/src/cacic_hardware.cpp b/src/cacic_hardware.cpp index 4de9f13..1b3edd5 100644 --- a/src/cacic_hardware.cpp +++ b/src/cacic_hardware.cpp @@ -287,6 +287,7 @@ QJsonObject cacic_hardware::coletaLinux() if ( getuid() != 0 ) qDebug() << "Coleta de Bios e Motherboard requer root."; coletaLinuxBios(hardware); coletaLinuxMotherboard(hardware); + coletaLinuxIsNotebook(hardware); return hardware; } @@ -414,6 +415,22 @@ void cacic_hardware::coletaLinuxMotherboard(QJsonObject &hardware) hardware["motherboard"] = motherboard; } +void cacic_hardware::coletaLinuxIsNotebook(QJsonObject &hardware) +{ + + QStringList consoleOutput; + + consoleOutput= console("dmidecode -t 3").split("\n"); +// qDebug() << consoleOutput; + foreach(QString line, consoleOutput){ + if(line.contains("Type:") + && line.contains("Notebook") ){ + hardware["is_notebook"] = QJsonValue::fromVariant(QString("true")); + } + } + +} + #endif QJsonObject cacic_hardware::toJsonObject() { return coletaHardware; diff --git a/src/cacic_hardware.h b/src/cacic_hardware.h index 4c29552..8943d78 100644 --- a/src/cacic_hardware.h +++ b/src/cacic_hardware.h @@ -33,6 +33,7 @@ private: void coletaLinuxPci(QJsonObject &hardware, const QJsonObject &pciJson); void coletaLinuxBios(QJsonObject &hardware); void coletaLinuxMotherboard(QJsonObject &hardware); + void coletaLinuxIsNotebook(QJsonObject &hardware); #endif CCacic oCacic; -- libgit2 0.21.2