aboutsummaryrefslogtreecommitdiff
path: root/lib/components/scan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/components/scan.cpp')
-rw-r--r--lib/components/scan.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/components/scan.cpp b/lib/components/scan.cpp
index 4d8d8b78..8fb60b58 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;
}