mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
stopParser
This commit is contained in:
@@ -59,6 +59,21 @@ AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, TypeList ty
|
||||
|
||||
AMMtasksWidget::~AMMtasksWidget()
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
taskTreePreparation->stopParser();
|
||||
|
||||
threadAnimation->quit();
|
||||
threadAnimation->wait();
|
||||
|
||||
threadPreparation->quit();
|
||||
threadPreparation->wait();
|
||||
|
||||
delete threadAnimation;
|
||||
delete threadPreparation;
|
||||
|
||||
delete taskTreePreparation;
|
||||
delete waitAnimationWidget;
|
||||
delete treeWidget;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
TaskTreePreparation::TaskTreePreparation(QObject *parent) :
|
||||
QObject(parent),
|
||||
listAllModules(nullptr)
|
||||
listAllModules(nullptr),
|
||||
flagStop(false)
|
||||
{
|
||||
qDebug() << "TaskTreePreparation init thread ID " << QThread::currentThreadId();
|
||||
}
|
||||
@@ -15,10 +16,18 @@ TaskTreePreparation::~TaskTreePreparation()
|
||||
deleteAllModuls();
|
||||
}
|
||||
|
||||
void TaskTreePreparation::stopParser()
|
||||
{
|
||||
flagStop = true;
|
||||
}
|
||||
|
||||
QTreeWidgetItem *TaskTreePreparation::addModuleToTreeWidget(Module *module, QTreeWidgetItem *parentItem)
|
||||
{
|
||||
QTreeWidgetItem* itemModule = nullptr;
|
||||
|
||||
if(flagStop)
|
||||
return itemModule;
|
||||
|
||||
QString text = "";
|
||||
QString ID = QString::number(module->getID());
|
||||
QString code = "";
|
||||
@@ -91,6 +100,9 @@ void TaskTreePreparation::domElementParser(QDomElement element, Module* modulePa
|
||||
{
|
||||
QString name;
|
||||
|
||||
if(flagStop)
|
||||
return;
|
||||
|
||||
QDomElement childElement = element.firstChildElement();
|
||||
if(childElement.isNull())
|
||||
return;
|
||||
|
||||
@@ -19,6 +19,9 @@ public:
|
||||
explicit TaskTreePreparation(QObject *parent = nullptr);
|
||||
~TaskTreePreparation();
|
||||
|
||||
public:
|
||||
void stopParser();
|
||||
|
||||
private:
|
||||
QTreeWidgetItem* addModuleToTreeWidget(Module* module, QTreeWidgetItem* parentItem = nullptr);
|
||||
void loadAMMtasksFromXML(QByteArray array);
|
||||
@@ -34,6 +37,7 @@ Q_SIGNALS:
|
||||
private:
|
||||
QList<QTreeWidgetItem*> listItems;
|
||||
QList<Module*>* listAllModules;
|
||||
bool flagStop;
|
||||
};
|
||||
|
||||
#endif // TASKTREEPREPARATION_H
|
||||
|
||||
Reference in New Issue
Block a user