Merge PR #172: NetworkDetector: Improve packaging and error handling
This commit is contained in:
commit
5a9bc109ca
1
debian/control
vendored
1
debian/control
vendored
@ -440,6 +440,7 @@ Depends: ${shlibs:Depends},
|
|||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
nmap,
|
nmap,
|
||||||
fping,
|
fping,
|
||||||
|
arping,
|
||||||
nymea-plugins-translations,
|
nymea-plugins-translations,
|
||||||
Replaces: guh-plugin-networkdetector
|
Replaces: guh-plugin-networkdetector
|
||||||
Description: nymea.io plugin for networkdetector
|
Description: nymea.io plugin for networkdetector
|
||||||
|
|||||||
@ -16,6 +16,15 @@ DeviceMonitor::DeviceMonitor(const QString &name, const QString &macAddress, con
|
|||||||
|
|
||||||
m_arpingProcess = new QProcess(this);
|
m_arpingProcess = new QProcess(this);
|
||||||
m_arpingProcess->setReadChannelMode(QProcess::MergedChannels);
|
m_arpingProcess->setReadChannelMode(QProcess::MergedChannels);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||||
|
// Actually we'd need this fix on older platforms too, but it's hard to figure this out without this API...
|
||||||
|
connect(m_arpingProcess, &QProcess::errorOccurred, this, [this](QProcess::ProcessError error) {
|
||||||
|
if (error == QProcess::FailedToStart) {
|
||||||
|
warn(QString("arping process failed to start. Falling back to ping. This plugin might not work properly on this system."));
|
||||||
|
ping();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endif
|
||||||
connect(m_arpingProcess, SIGNAL(finished(int)), this, SLOT(arpingFinished(int)));
|
connect(m_arpingProcess, SIGNAL(finished(int)), this, SLOT(arpingFinished(int)));
|
||||||
|
|
||||||
m_pingProcess = new QProcess(this);
|
m_pingProcess = new QProcess(this);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user