#3452 Command execution. Clear cached data before executing new commands

This commit is contained in:
Bjørn Erik Jensen 2018-10-04 10:40:48 +02:00
parent 273c2912ae
commit ce26437130
2 changed files with 13 additions and 0 deletions

View File

@ -61,6 +61,8 @@ void RicfCommandFileExecutor::executeCommands(QTextStream& stream)
RicfMessages messages;
std::vector<RicfCommandObject*> executableCommands;
{
clearCachedData();
std::vector<RicfCommandObject*> fileCommands = RicfCommandFileReader::readCommands(stream, caf::PdmDefaultObjectFactory::instance(), &messages);
for (auto message : messages.m_messages)
{
@ -214,3 +216,12 @@ std::vector<RicfCommandObject*> RicfCommandFileExecutor::prepareFileCommandsForE
return executableCommands;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicfCommandFileExecutor::clearCachedData()
{
m_exportPaths.clear();
m_lastProjectPath.clear();
}

View File

@ -60,6 +60,8 @@ public:
static std::vector<RicfCommandObject*> prepareFileCommandsForExecution(const std::vector<RicfCommandObject*>& commandsReadFromFile);
private:
void clearCachedData();
std::map<ExportType, QString> m_exportPaths;
QString m_lastProjectPath;
};