Fixed Session load recursion, allow higher level of imbrication

Recursive load of SessionFile in a Session is now detected by filename and prevented. Deeper level of integration of sessionfile inside session is thus possible (set to 3). Sessions now have an id, allowing to reference them by id in the logs. Terminology is clarified between level and recursion.
This commit is contained in:
Bruno Herbelin
2022-04-08 17:44:39 +02:00
parent ef65dd8cc6
commit 33756c775c
7 changed files with 84 additions and 49 deletions

View File

@@ -75,6 +75,7 @@ bool SessionVisitor::saveSession(const std::string& filename, Session *session)
(*iter)->accept(sv);
// save session attributes
sessionNode->SetAttribute("id", session->id());
sessionNode->SetAttribute("activationThreshold", session->activationThreshold());
// save the thumbnail
@@ -664,6 +665,7 @@ void SessionVisitor::visit (SessionGroupSource& s)
Session *se = s.session();
if (se) {
XMLElement *sessionNode = xmlDoc_->NewElement("Session");
sessionNode->SetAttribute("id", se->id());
xmlCurrent_->InsertEndChild(sessionNode);
for (auto iter = se->begin(); iter != se->end(); ++iter){