From 2108422dc2ad48fe11ab8a6c36070f4ff8ce1644 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 24 Dec 2016 23:44:01 +0100 Subject: [PATCH] refs #844, allow to remove ATC stations outside of range --- src/blackmisc/aviation/atcstationlist.cpp | 5 +++++ src/blackmisc/aviation/atcstationlist.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/blackmisc/aviation/atcstationlist.cpp b/src/blackmisc/aviation/atcstationlist.cpp index 08ba0e31f..01c687fd4 100644 --- a/src/blackmisc/aviation/atcstationlist.cpp +++ b/src/blackmisc/aviation/atcstationlist.cpp @@ -56,6 +56,11 @@ namespace BlackMisc return this->findBy(Predicates::MemberValid(&CAtcStation::getController)).transform(Predicates::MemberTransform(&CAtcStation::getController)); } + int CAtcStationList::removeIfOutsideRange() + { + return this->removeIf(&CAtcStation::isInRange, false); + } + int CAtcStationList::synchronizeWithBookedStation(CAtcStation &bookedAtcStation) { int c = 0; diff --git a/src/blackmisc/aviation/atcstationlist.h b/src/blackmisc/aviation/atcstationlist.h index 2a6fdd208..cd051b730 100644 --- a/src/blackmisc/aviation/atcstationlist.h +++ b/src/blackmisc/aviation/atcstationlist.h @@ -59,6 +59,9 @@ namespace BlackMisc //! All controllers (with valid data) BlackMisc::Network::CUserList getControllers() const; + //! Remove if marked outside of range + int removeIfOutsideRange(); + //! Synchronize with ATC station representing booking information. //! Both sides (booking, online station) will be updated. //! \pre Can be used only if the stored data in this list are online ATC stations