Subversion Repositories OpenInventory

Rev

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

#ifndef WMITHREAD_H
#define WMITHREAD_H

#include <QThread>
#include <QProcess>
#include <QMutex>

class WmiThread : public QThread
{
    Q_OBJECT
public:
    explicit WmiThread(QObject *parent = 0);
    void run();
    void stop();
    void setHost(QString new_host){host = new_host;}
    void setUser(QString new_user){user_name = new_user;}
    void setPassword(QString new_password){password = new_password;}
    QByteArray buffer(){return p_buffer;}
    void clearBuffer(){p_buffer.clear();}
private:
    volatile bool stopped;
    volatile bool error;
    QProcess process;
    QString host;
    QString user_name;
    QString password;
    QMutex mutex;
    QByteArray p_buffer; //çäåñü áóäåì õðàíèòü äàííûå, ñ÷èòàííûå èç ñòàíäàðòíîãî ïîòîêà äëÿ ÷òåíèÿ (ïðîöåññà)

signals:

public slots:


private slots:

    void readStandartProcessOutput();
    void readStandartProcessError();

};

#endif // WMITHREAD_H