Don't clean the devices that looked us up in the first place
This commit is contained in:
parent
2707d1f0a8
commit
2c2cb21ee1
3 changed files with 16 additions and 1 deletions
|
@ -123,7 +123,7 @@ void Daemon::removeDevice(Device* device)
|
|||
void Daemon::cleanDevices()
|
||||
{
|
||||
Q_FOREACH(Device* device, d->mDevices) {
|
||||
if (!device->isPaired()) {
|
||||
if (!device->isPaired() && device->connectionSource() == DeviceLink::ConnectionStarted::Remotely) {
|
||||
removeDevice(device);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -489,6 +489,18 @@ void Device::setAsPaired()
|
|||
|
||||
}
|
||||
|
||||
DeviceLink::ConnectionStarted Device::connectionSource() const
|
||||
{
|
||||
DeviceLink::ConnectionStarted ret = DeviceLink::Remotely;
|
||||
Q_FOREACH(DeviceLink* link, m_deviceLinks) {
|
||||
if(link->connectionSource() == DeviceLink::ConnectionStarted::Locally) {
|
||||
ret = DeviceLink::ConnectionStarted::Locally;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
QStringList Device::availableLinks() const
|
||||
{
|
||||
QStringList sl;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <QtCrypto>
|
||||
|
||||
#include "networkpackage.h"
|
||||
#include "backends/devicelink.h"
|
||||
|
||||
class DeviceLink;
|
||||
class KdeConnectPlugin;
|
||||
|
@ -108,6 +109,8 @@ public:
|
|||
void setPluginEnabled(const QString& pluginName, bool enabled);
|
||||
bool isPluginEnabled(const QString& pluginName) const;
|
||||
|
||||
DeviceLink::ConnectionStarted connectionSource() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
///sends a @p np package to the device
|
||||
virtual bool sendPackage(NetworkPackage& np);
|
||||
|
|
Loading…
Reference in a new issue