Subversion Repositories OpenInventory

Rev

Rev 241 | Rev 243 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 241 Rev 242
Line 2... Line 2...
2
#define WMITHREAD_H
2
#define WMITHREAD_H
3
3
4
#include <QThread>
4
#include <QThread>
5
#include <QProcess>
5
#include <QProcess>
6
#include <QMutex>
6
#include <QMutex>
-
 
7
#include <QDebug>
7
8
8
class WmiThread : public QThread
9
class WmiThread : public QThread
9
{
10
{
10
    Q_OBJECT
11
    Q_OBJECT
11
public:
12
public:
Line 16... Line 17...
16
    void setUser(QString new_user){user_name = new_user;}
17
    void setUser(QString new_user){user_name = new_user;}
17
    void setPassword(QString new_password){password = new_password;}
18
    void setPassword(QString new_password){password = new_password;}
18
    QByteArray buffer(){return p_buffer;}
19
    QByteArray buffer(){return p_buffer;}
19
    void clearBuffer(){p_buffer.clear();}
20
    void clearBuffer(){p_buffer.clear();}
20
    bool isError(){return error;}
21
    bool isError(){return error;}
-
 
22
    bool isStopped(){
-
 
23
        mutex.lock();
-
 
24
        return stopped;
-
 
25
        mutex.unlock();
-
 
26
-
 
27
                        };
21
    void setWmiString(QString new_wmi_string){wmi_string = new_wmi_string;}
28
    void setWmiString(QString new_wmi_string){wmi_string = new_wmi_string;}
22
private:
29
private:
23
    volatile bool stopped;
30
    volatile bool stopped;
24
    volatile bool error;
31
    volatile bool error;
25
    QProcess process;
32
   QProcess process;
26
    QString host;
33
    QString host;
27
    QString user_name;
34
    QString user_name;
28
    QString password;
35
    QString password;
29
    QMutex mutex;
36
    QMutex mutex;
30
    QByteArray p_buffer; //çäåñü áóäåì õðàíèòü äàííûå, ñ÷èòàííûå èç ñòàíäàðòíîãî ïîòîêà äëÿ ÷òåíèÿ (ïðîöåññà)
37
    QByteArray p_buffer; //çäåñü áóäåì õðàíèòü äàííûå, ñ÷èòàííûå èç ñòàíäàðòíîãî ïîòîêà äëÿ ÷òåíèÿ (ïðîöåññà)