Commit 420c77f9430e9232d514fac510f62edc970074f3

Authored by LightBase Consultoria em Software Publico
1 parent 39f00f36
Exists in master

x

cacic-teste/cacic-teste.pro
@@ -9,7 +9,6 @@ QT += network @@ -9,7 +9,6 @@ QT += network
9 9
10 TARGET = cacic-teste 10 TARGET = cacic-teste
11 CONFIG -= app_bundle 11 CONFIG -= app_bundle
12 -LIBS += -L/usr/lib -lcryptopp  
13 TEMPLATE = app 12 TEMPLATE = app
14 13
15 14
cacic-teste/testcacic.cpp
@@ -91,3 +91,7 @@ void CTestCacic::testpegarIPInterfaceDeRede(){ @@ -91,3 +91,7 @@ void CTestCacic::testpegarIPInterfaceDeRede(){
91 void CTestCacic::testpegarMACInterfaceDeRede(){ 91 void CTestCacic::testpegarMACInterfaceDeRede(){
92 QVERIFY(OCacicComp.pegarMACInterfaceDeRede() == "E0:3F:49:E4:70:12"); 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
@@ -40,6 +40,7 @@ private slots: @@ -40,6 +40,7 @@ private slots:
40 void testDeleteFile(); 40 void testDeleteFile();
41 void testpegarIPInterfaceDeRede(); 41 void testpegarIPInterfaceDeRede();
42 void testpegarMACInterfaceDeRede(); 42 void testpegarMACInterfaceDeRede();
  43 + void testpegarOS();
43 }; 44 };
44 45
45 #endif // TESTINSTALLCACIC_H 46 #endif // TESTINSTALLCACIC_H
src/cacic_computer.cpp
@@ -31,7 +31,7 @@ std::string CACIC_Computer::pegarIPInterfaceDeRede() { @@ -31,7 +31,7 @@ std::string CACIC_Computer::pegarIPInterfaceDeRede() {
31 break; 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,4 +43,16 @@ std::string CACIC_Computer::pegarMACInterfaceDeRede(){
43 break; 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,6 +15,7 @@ public:
15 explicit CACIC_Computer(QObject *parent = 0); 15 explicit CACIC_Computer(QObject *parent = 0);
16 std::string pegarIPInterfaceDeRede(); 16 std::string pegarIPInterfaceDeRede();
17 std::string pegarMACInterfaceDeRede(); 17 std::string pegarMACInterfaceDeRede();
  18 + std::string pegarOS();
18 void setIp(const std::string &value); 19 void setIp(const std::string &value);
19 void setMac(const std::string &value); 20 void setMac(const std::string &value);
20 void setOs(const std::string &value); 21 void setOs(const std::string &value);
@@ -15,7 +15,6 @@ @@ -15,7 +15,6 @@
15 #include <crypto++/md5.h> 15 #include <crypto++/md5.h>
16 #include <QSettings> 16 #include <QSettings>
17 #include <QDir> 17 #include <QDir>
18 -#include "crypt/aes.h"  
19 18
20 class CCacic : public QObject 19 class CCacic : public QObject
21 { 20 {