fix commandlauncher inputType

pull/135/head
Simon Stürz 2016-02-21 12:03:28 +01:00 committed by Michael Zanetti
parent a525853ec5
commit 4ef747e846
2 changed files with 5 additions and 2 deletions

View File

@ -25,7 +25,7 @@
{
"name": "command",
"type": "QString",
"inputType": "Url"
"inputType": "TextLine"
}
],
"stateTypes": [

View File

@ -67,6 +67,8 @@ DeviceManager::HardwareResources DevicePluginWifiDetector::requiredHardware() co
void DevicePluginWifiDetector::guhTimer()
{
QProcess *p = new QProcess(this);
connect(p, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
p->start(QStringLiteral("sudo"), QStringList() << "nmap" << "-sP" << "10.10.10.0/24");
@ -75,7 +77,6 @@ void DevicePluginWifiDetector::guhTimer()
void DevicePluginWifiDetector::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
QProcess *p = static_cast<QProcess*>(sender());
p->deleteLater();
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
qCWarning(dcWifiDetector) << "error performing network scan:" << p->readAllStandardError();
@ -84,6 +85,7 @@ void DevicePluginWifiDetector::processFinished(int exitCode, QProcess::ExitStatu
QList<Device*> watchedDevices = deviceManager()->findConfiguredDevices(supportedDevices().first().id());
if (watchedDevices.isEmpty()) {
p->deleteLater();
return;
}
@ -106,4 +108,5 @@ void DevicePluginWifiDetector::processFinished(int exitCode, QProcess::ExitStatu
device->setStateValue(inRangeStateTypeId, wasFound);
}
}
p->deleteLater();
}