Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 240 → Rev 241

/trunk/DBViewer/wmithread.cpp
3,16 → 3,35
WmiThread::WmiThread(QObject *parent) :
QThread(parent)
{
connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandartProcessOutput()));
connect(&process, SIGNAL(readyReadStandardError()), this, SLOT(readStandartProcessError()));
mutex.lock();
stopped = false;
mutex.unlock();
 
 
 
 
 
}
 
void WmiThread::run(){
error = false; //ñáðîñèì ôëàã îøèáêè
 
 
 
QString query_string;
error = false; //ñáðîñèì ôëàã îøèáêè
query_string = tr("wmic -U ");
query_string.append(user_name);
query_string.append(tr("%"));
query_string.append(password);
query_string.append(tr(" //"));
query_string.append(host);
query_string.append(tr(" \""));
query_string.append(wmi_string);
query_string.append(tr("\""));
process.start(query_string);
 
while (!stopped);
// exec();
}
 
void WmiThread::stop(){
23,9 → 42,12
 
void WmiThread::readStandartProcessOutput(){
p_buffer = process.readAllStandardOutput();
mutex.lock();
stopped = true;
mutex.unlock();
}
 
void WmiThread::readStandartProcessError(){
p_buffer = process.readAllStandardError();
error = true;
error = true; // åñëè îøèáêà, óñòàíîâèì ôëàã îøèáêè âûïîëíåíèÿ WMI-çàïðîñà
}