fix commandlauncher inputType
This commit is contained in:
parent
a525853ec5
commit
4ef747e846
@ -25,7 +25,7 @@
|
|||||||
{
|
{
|
||||||
"name": "command",
|
"name": "command",
|
||||||
"type": "QString",
|
"type": "QString",
|
||||||
"inputType": "Url"
|
"inputType": "TextLine"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stateTypes": [
|
"stateTypes": [
|
||||||
|
|||||||
@ -67,6 +67,8 @@ DeviceManager::HardwareResources DevicePluginWifiDetector::requiredHardware() co
|
|||||||
|
|
||||||
void DevicePluginWifiDetector::guhTimer()
|
void DevicePluginWifiDetector::guhTimer()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
QProcess *p = new QProcess(this);
|
QProcess *p = new QProcess(this);
|
||||||
connect(p, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus)));
|
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");
|
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)
|
void DevicePluginWifiDetector::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
QProcess *p = static_cast<QProcess*>(sender());
|
QProcess *p = static_cast<QProcess*>(sender());
|
||||||
p->deleteLater();
|
|
||||||
|
|
||||||
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
|
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
|
||||||
qCWarning(dcWifiDetector) << "error performing network scan:" << p->readAllStandardError();
|
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());
|
QList<Device*> watchedDevices = deviceManager()->findConfiguredDevices(supportedDevices().first().id());
|
||||||
if (watchedDevices.isEmpty()) {
|
if (watchedDevices.isEmpty()) {
|
||||||
|
p->deleteLater();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,4 +108,5 @@ void DevicePluginWifiDetector::processFinished(int exitCode, QProcess::ExitStatu
|
|||||||
device->setStateValue(inRangeStateTypeId, wasFound);
|
device->setStateValue(inRangeStateTypeId, wasFound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
p->deleteLater();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user