mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use PdmPointers for command queue in RiaApplication
This commit is contained in:
parent
49ffe9b53a
commit
e847ce7cd3
@ -1302,31 +1302,25 @@ void RiaApplication::addCommandObject( RimCommandObject* commandObject )
|
||||
void RiaApplication::executeCommandObjects()
|
||||
{
|
||||
{
|
||||
std::list<RimCommandObject*>::iterator it = m_commandQueue.begin();
|
||||
while ( it != m_commandQueue.end() )
|
||||
auto currentCommandQueue = m_commandQueue;
|
||||
for ( auto command : currentCommandQueue )
|
||||
{
|
||||
RimCommandObject* toBeRemoved = *it;
|
||||
if ( !toBeRemoved->isAsyncronous() )
|
||||
if ( command->isAsyncronous() )
|
||||
{
|
||||
toBeRemoved->redo();
|
||||
|
||||
++it;
|
||||
m_commandQueue.remove( toBeRemoved );
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
command->redo();
|
||||
m_commandQueue.remove( command );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !m_commandQueue.empty() )
|
||||
{
|
||||
std::list<RimCommandObject*>::iterator it = m_commandQueue.begin();
|
||||
|
||||
RimCommandObject* first = *it;
|
||||
first->redo();
|
||||
|
||||
auto it = m_commandQueue.begin();
|
||||
if ( it->notNull() )
|
||||
{
|
||||
RimCommandObject* first = *it;
|
||||
first->redo();
|
||||
}
|
||||
m_commandQueue.pop_front();
|
||||
}
|
||||
else
|
||||
|
@ -262,8 +262,8 @@ protected:
|
||||
QString m_commandLineHelpText;
|
||||
QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session
|
||||
|
||||
std::list<RimCommandObject*> m_commandQueue;
|
||||
QMutex m_commandQueueLock;
|
||||
std::list<caf::PdmPointer<RimCommandObject>> m_commandQueue;
|
||||
QMutex m_commandQueueLock;
|
||||
|
||||
bool m_runningWorkerProcess;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user