Subversion Repositories OpenInventory

Rev

Rev 241 | Go to most recent revision | Details | 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>
7
 
8
class WmiThread : public QThread
9
{
10
    Q_OBJECT
11
public:
12
    explicit WmiThread(QObject *parent = 0);
13
    void run();
14
    void stop();
15
    void setHost(QString new_host){host = new_host;}
16
    void setUser(QString new_user){user_name = new_user;}
17
    void setPassword(QString new_password){password = new_password;}
18
    QByteArray buffer(){return p_buffer;}
19
    void clearBuffer(){p_buffer.clear();}
20
private:
21
    volatile bool stopped;
22
    volatile bool error;
23
    QProcess process;
24
    QString host;
25
    QString user_name;
26
    QString password;
27
    QMutex mutex;
28
    QByteArray p_buffer; //   ,       ()
29
 
30
signals:
31
 
32
public slots:
33
 
34
 
35
private slots:
36
 
37
    void readStandartProcessOutput();
38
    void readStandartProcessError();
39
 
40
};
41
 
42
#endif // WMITHREAD_H