From: Andreas Monzner Date: Fri, 14 Sep 2007 23:28:08 +0000 (+0000) Subject: remove new found flags when do a automatic scan and "clear before scan" was X-Git-Tag: 2.6.0~1914 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/09047544dbeddd0a5df972934c8863bef9e11a99?ds=sidebyside remove new found flags when do a automatic scan and "clear before scan" was not checked --- diff --git a/lib/components/scan.cpp b/lib/components/scan.cpp index 79fe2ef5..a863d923 100644 --- a/lib/components/scan.cpp +++ b/lib/components/scan.cpp @@ -106,11 +106,48 @@ int eComponentScan::start(int feid, int flags) } std::list > list; - m_scan = new eDVBScan(channel); m_scan->connectEvent(slot(*this, &eComponentScan::scanEvent), m_scan_event_connection); + + if (!(flags & scanRemoveServices)) + { + ePtr db; + ePtr res; + int err; + if ((err = eDVBResourceManager::getInstance(res)) != 0) + eDebug("no resource manager"); + else if ((err = res->getChannelList(db)) != 0) + eDebug("no channel list"); + else + { + if (m_initial.size() > 1) + { + iDVBFrontendParameters *tp = m_initial.first(); + int type; + if (tp && !tp->getSystem(type)) + { + switch(type) + { + case iDVBFrontend::feSatellite: + { + eDVBFrontendParametersSatellite parm; + tp->getDVBS(parm); + db->removeFlags(eDVBService::dxNewFound, -1, -1, -1, parm.orbital_position); + break; + } + case iDVBFrontend::feCable: + db->removeFlags(eDVBService::dxNewFound, 0xFFFF0000, -1, -1, -1); + break; + case iDVBFrontend::feTerrestrial: + db->removeFlags(eDVBService::dxNewFound, 0xEEEE0000, -1, -1, -1); + break; + } + } + } + } + } m_scan->start(m_initial, flags); - + return 0; }