Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 241 → Rev 242

/trunk/DBViewer/wmithread.cpp
3,11 → 3,12
WmiThread::WmiThread(QObject *parent) :
QThread(parent)
{
connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandartProcessOutput()));
connect(&process, SIGNAL(readyReadStandardError()), this, SLOT(readStandartProcessError()));
process.moveToThread(this);
mutex.lock();
stopped = false;
mutex.unlock();
connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandartProcessOutput()));
connect(&process, SIGNAL(readyReadStandardError()), this, SLOT(readStandartProcessError()));
 
 
 
17,6 → 18,7
 
 
 
 
QString query_string;
error = false; //ñáðîñèì ôëàã îøèáêè
query_string = tr("wmic -U ");
28,10 → 30,11
query_string.append(tr(" \""));
query_string.append(wmi_string);
query_string.append(tr("\""));
process.start(query_string);
 
while (!stopped);
// exec();
// process.start(query_string);
process.start("ls\n");
// while (!stopped) {;}
exec();
// quit();
}
 
void WmiThread::stop(){
42,9 → 45,12
 
void WmiThread::readStandartProcessOutput(){
p_buffer = process.readAllStandardOutput();
qDebug() << QString(p_buffer);
mutex.lock();
stopped = true;
mutex.unlock();
process.close();
exit();
}
 
void WmiThread::readStandartProcessError(){