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()
|
void RiaApplication::executeCommandObjects()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::list<RimCommandObject*>::iterator it = m_commandQueue.begin();
|
auto currentCommandQueue = m_commandQueue;
|
||||||
while ( it != m_commandQueue.end() )
|
for ( auto command : currentCommandQueue )
|
||||||
{
|
{
|
||||||
RimCommandObject* toBeRemoved = *it;
|
if ( command->isAsyncronous() )
|
||||||
if ( !toBeRemoved->isAsyncronous() )
|
|
||||||
{
|
{
|
||||||
toBeRemoved->redo();
|
command->redo();
|
||||||
|
m_commandQueue.remove( command );
|
||||||
++it;
|
|
||||||
m_commandQueue.remove( toBeRemoved );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++it;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !m_commandQueue.empty() )
|
if ( !m_commandQueue.empty() )
|
||||||
{
|
{
|
||||||
std::list<RimCommandObject*>::iterator it = m_commandQueue.begin();
|
auto it = m_commandQueue.begin();
|
||||||
|
if ( it->notNull() )
|
||||||
RimCommandObject* first = *it;
|
{
|
||||||
first->redo();
|
RimCommandObject* first = *it;
|
||||||
|
first->redo();
|
||||||
|
}
|
||||||
m_commandQueue.pop_front();
|
m_commandQueue.pop_front();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -262,8 +262,8 @@ protected:
|
|||||||
QString m_commandLineHelpText;
|
QString m_commandLineHelpText;
|
||||||
QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session
|
QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session
|
||||||
|
|
||||||
std::list<RimCommandObject*> m_commandQueue;
|
std::list<caf::PdmPointer<RimCommandObject>> m_commandQueue;
|
||||||
QMutex m_commandQueueLock;
|
QMutex m_commandQueueLock;
|
||||||
|
|
||||||
bool m_runningWorkerProcess;
|
bool m_runningWorkerProcess;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user