summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-08 15:22:01 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-08 15:22:01 (GMT)
commite774127ffca03dab4adad276070036f4998441d5 (patch)
treee9ae42a61337e64d17a96ce7a939d3955bcaf975
parentab1f93612a42eb6efefd285fd483a1af6a619f3a (diff)
Search by name and then by label and only if found add it to pi exec drivers.
-rw-r--r--kstars/indi/indiwebmanager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/kstars/indi/indiwebmanager.cpp b/kstars/indi/indiwebmanager.cpp
index 7f7f7c9..33d67e2 100644
--- a/kstars/indi/indiwebmanager.cpp
+++ b/kstars/indi/indiwebmanager.cpp
@@ -121,12 +121,19 @@ namespace WebManager
{
QJsonArray array = json.array();
+ if (array.isEmpty())
+ return false;
+
QStringList piExecDrivers;
QMapIterator<QString, QString> i(pi->drivers);
while (i.hasNext())
{
QString name = i.next().value();
- piExecDrivers << DriverManager::Instance()->findDriverByName(name)->getDriver();
+ DriverInfo *driver = DriverManager::Instance()->findDriverByName(name);
+ if (driver == NULL)
+ driver = DriverManager::Instance()->findDriverByLabel(name);
+ if (driver)
+ piExecDrivers << driver->getDriver();
}
if (array.count() < piExecDrivers.count())