diff --git a/src/blackmisc/simulation/simulatorinfo.cpp b/src/blackmisc/simulation/simulatorinfo.cpp index 7b4188dca..00ecb369b 100644 --- a/src/blackmisc/simulation/simulatorinfo.cpp +++ b/src/blackmisc/simulation/simulatorinfo.cpp @@ -181,10 +181,15 @@ namespace BlackMisc return CValueObject::toIcon(); } - void CSimulatorInfo::add(const CSimulatorInfo &other) + CSimulatorInfo CSimulatorInfo::add(const CSimulatorInfo &other) { - if (other.isUnspecified()) { return; } + // anything to add? + if (other.isUnspecified()) { return None; } + if (this->matchesAll(other)) { return None; } + this->setSimulator(this->getSimulator() | other.getSimulator()); + const CSimulatorInfo delta(this->getSimulator() & other.getSimulator()); + return delta; } QSet CSimulatorInfo::asSingleSimulatorSet() const diff --git a/src/blackmisc/simulation/simulatorinfo.h b/src/blackmisc/simulation/simulatorinfo.h index 31af5cb07..7b8ab071c 100644 --- a/src/blackmisc/simulation/simulatorinfo.h +++ b/src/blackmisc/simulation/simulatorinfo.h @@ -157,7 +157,7 @@ namespace BlackMisc CIcon toIcon() const; //! Add simulator - void add(const CSimulatorInfo &other); + CSimulatorInfo add(const CSimulatorInfo &other); //! As a set of single simulator info objects QSet asSingleSimulatorSet() const;