Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 242 → Rev 243

/trunk/DBViewer/wmithread.cpp
3,21 → 3,27
WmiThread::WmiThread(QObject *parent) :
QThread(parent)
{
process.moveToThread(this);
// woker.moveToThread(this);
mutex.lock();
stopped = false;
mutex.unlock();
connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandartProcessOutput()));
connect(&process, SIGNAL(readyReadStandardError()), this, SLOT(readStandartProcessError()));
 
// connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandartProcessOutput()));
// connect(&process, SIGNAL(readyReadStandardError()), this, SLOT(readStandartProcessError()));
 
 
 
}
 
void WmiThread::run(){
 
 
QEventLoop * loop = new QEventLoop();
Woker woker; // îáúåêò äëÿ ðàáîòû â òåëå ïîòîêà
 
// connect(&woker, SIGNAL(workEnd()), this, SLOT(wokerIsStopped()));
connect(&woker, SIGNAL(workEnd()), loop, SLOT(quit()));
/*
 
QString query_string;
error = false; //ñáðîñèì ôëàã îøèáêè
33,8 → 39,13
// process.start(query_string);
process.start("ls\n");
// while (!stopped) {;}
exec();
// quit();
 
 
*/
 
woker.startProcess();
 
loop->exec();
}
 
void WmiThread::stop(){
57,3 → 68,8
p_buffer = process.readAllStandardError();
error = true; // åñëè îøèáêà, óñòàíîâèì ôëàã îøèáêè âûïîëíåíèÿ WMI-çàïðîñà
}
 
 
void WmiThread::wokerIsStopped(){
exit();
}