X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fcomponents%2Fscan.cpp;fp=lib%2Fcomponents%2Fscan.cpp;h=8fb60b5863237ba81fe3b932597b539715fab42b;hb=1cdf6cb021fcaa6548b90ba7b6765cf1e8b8b37b;hp=4d8d8b782c570ffd68483b6501ab982c9d9fc09f;hpb=e677ac4a7bf81391877c909a703e5918ce4a511b;p=vuplus_dvbapp diff --git a/lib/components/scan.cpp b/lib/components/scan.cpp index 4d8d8b7..8fb60b5 100644 --- a/lib/components/scan.cpp +++ b/lib/components/scan.cpp @@ -20,23 +20,29 @@ void eComponentScan::scanEvent(int evt) if ((err = eDVBResourceManager::getInstance(res)) != 0) { eDebug("no resource manager"); - return; - } - if ((err = res->getChannelList(db)) != 0) + m_failed = 2; + } else if ((err = res->getChannelList(db)) != 0) { + m_failed = 3; eDebug("no channel list"); - return; + } else + { + m_scan->insertInto(db); + eDebug("scan done!"); } - - m_scan->insertInto(db); - - eDebug("scan done!"); + } + + if (evt == eDVBScan::evtFail) + { + eDebug("scan failed."); + m_failed = 1; + m_done = 1; } statusChanged(); } -eComponentScan::eComponentScan(): m_done(-1) +eComponentScan::eComponentScan(): m_done(-1), m_failed(0) { } @@ -77,8 +83,8 @@ int eComponentScan::start() list.push_back(fe); m_scan = new eDVBScan(channel); - m_scan->start(list); m_scan->connectEvent(slot(*this, &eComponentScan::scanEvent), m_scan_event_connection); + m_scan->start(list); return 0; }