Commit 420c77f9430e9232d514fac510f62edc970074f3
1 parent
39f00f36
Exists in
master
x
Showing
6 changed files
with
19 additions
and
3 deletions
Show diff stats
cacic-teste/cacic-teste.pro
cacic-teste/testcacic.cpp
| ... | ... | @@ -91,3 +91,7 @@ void CTestCacic::testpegarIPInterfaceDeRede(){ |
| 91 | 91 | void CTestCacic::testpegarMACInterfaceDeRede(){ |
| 92 | 92 | QVERIFY(OCacicComp.pegarMACInterfaceDeRede() == "E0:3F:49:E4:70:12"); |
| 93 | 93 | } |
| 94 | + | |
| 95 | +void CTestCacic::testpegarOS(){ | |
| 96 | + QVERIFY(OCacicComp.pegarOS() == "linux"); | |
| 97 | +} | ... | ... |
cacic-teste/testcacic.h
src/cacic_computer.cpp
| ... | ... | @@ -31,7 +31,7 @@ std::string CACIC_Computer::pegarIPInterfaceDeRede() { |
| 31 | 31 | break; |
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | - return result.at(0).toString().toStdString() ; | |
| 34 | + return result.at(0).toString().toStdString(); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| ... | ... | @@ -43,4 +43,16 @@ std::string CACIC_Computer::pegarMACInterfaceDeRede(){ |
| 43 | 43 | break; |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | + return "ERROR MAC"; | |
| 47 | +} | |
| 48 | + | |
| 49 | +std::string CACIC_Computer::pegarOS(){ | |
| 50 | + QString text; | |
| 51 | + qint32 x=0; | |
| 52 | + //QStringList environment = QProcessEnvironment::systemEnvironment().toStringList(); | |
| 53 | + QStringList environment = QProcess::systemEnvironment(); | |
| 54 | +// foreach (text, environment) { | |
| 55 | +// qDebug() << x << sear; | |
| 56 | +// x++; | |
| 57 | +// } | |
| 46 | 58 | } | ... | ... |
src/cacic_computer.h
| ... | ... | @@ -15,6 +15,7 @@ public: |
| 15 | 15 | explicit CACIC_Computer(QObject *parent = 0); |
| 16 | 16 | std::string pegarIPInterfaceDeRede(); |
| 17 | 17 | std::string pegarMACInterfaceDeRede(); |
| 18 | + std::string pegarOS(); | |
| 18 | 19 | void setIp(const std::string &value); |
| 19 | 20 | void setMac(const std::string &value); |
| 20 | 21 | void setOs(const std::string &value); | ... | ... |