Subversion Repositories OpenInventory

Rev

Rev 241 | Rev 243 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
239 pingvin 1
#ifndef WMITHREAD_H
2
#define WMITHREAD_H
3
 
4
#include <QThread>
5
#include <QProcess>
6
#include <QMutex>
242 pingvin 7
#include <QDebug>
239 pingvin 8
 
9
class WmiThread : public QThread
10
{
11
    Q_OBJECT
12
public:
13
    explicit WmiThread(QObject *parent = 0);
14
    void run();
15
    void stop();
16
    void setHost(QString new_host){host = new_host;}
17
    void setUser(QString new_user){user_name = new_user;}
18
    void setPassword(QString new_password){password = new_password;}
19
    QByteArray buffer(){return p_buffer;}
20
    void clearBuffer(){p_buffer.clear();}
241 pingvin 21
    bool isError(){return error;}
242 pingvin 22
    bool isStopped(){
23
        mutex.lock();
24
        return stopped;
25
        mutex.unlock();
26
 
27
                        };
241 pingvin 28
    void setWmiString(QString new_wmi_string){wmi_string = new_wmi_string;}
239 pingvin 29
private:
30
    volatile bool stopped;
31
    volatile bool error;
242 pingvin 32
   QProcess process;
239 pingvin 33
    QString host;
34
    QString user_name;
35
    QString password;
36
    QMutex mutex;
37
    QByteArray p_buffer; //   ,       ()
241 pingvin 38
    QString wmi_string;  //   wmi-
239 pingvin 39
 
40
signals:
41
 
42
public slots:
241 pingvin 43
    void readStandartProcessOutput();
44
    void readStandartProcessError();
239 pingvin 45
 
46
private slots:
47
 
48
 
241 pingvin 49
 
239 pingvin 50
};
51
 
52
#endif // WMITHREAD_H