Implement "holdover events," noting those log events which are not listed in the currently loaded log but which are present because they were playing when this log was loaded.

This fixes problems arising when the duplicate IDs thus introduced cause confusion.
This commit is contained in:
Chris Smowton
2014-09-21 23:42:51 +01:00
parent 242141d887
commit 94e80606c5
5 changed files with 58 additions and 18 deletions

View File

@@ -626,20 +626,22 @@ void RDLogEvent::setLogLine(int line,RDLogLine *ll)
}
RDLogLine *RDLogEvent::loglineById(int id) const
RDLogLine *RDLogEvent::loglineById(int id, bool ignore_holdovers) const
{
for(int i=0;i<size();i++) {
if(log_line[i]->id()==id) {
return log_line[i];
}
}
return NULL;
int line = lineById(id, ignore_holdovers);
if(line == -1)
return NULL;
else
return log_line[line];
}
int RDLogEvent::lineById(int id) const
int RDLogEvent::lineById(int id, bool ignore_holdovers) const
{
for(int i=0;i<size();i++) {
if(ignore_holdovers && log_line[i]->isHoldover()) {
continue;
}
if(log_line[i]->id()==id) {
return i;
}