Rough enable/disable for lanlink
This commit is contained in:
parent
bc48c5e9f8
commit
97841c8634
4 changed files with 32 additions and 19 deletions
|
@ -73,6 +73,21 @@ void BluetoothLinkProvider::onStop()
|
|||
}
|
||||
}
|
||||
|
||||
void BluetoothLinkProvider::enable()
|
||||
{
|
||||
enabled = true;
|
||||
tryToInitialise();
|
||||
}
|
||||
|
||||
void BluetoothLinkProvider::disable()
|
||||
{
|
||||
enabled = false;
|
||||
this->onStop();
|
||||
|
||||
mBluetoothServer = nullptr;
|
||||
mServiceDiscoveryAgent = nullptr;
|
||||
}
|
||||
|
||||
void BluetoothLinkProvider::onNetworkChange()
|
||||
{
|
||||
qCDebug(KDECONNECT_CORE) << "BluetoothLinkProvider::onNetworkChange executed";
|
||||
|
|
|
@ -42,20 +42,9 @@ public:
|
|||
return 10;
|
||||
}
|
||||
|
||||
void enable() override
|
||||
{
|
||||
enabled = true;
|
||||
tryToInitialise();
|
||||
}
|
||||
void enable() override;
|
||||
|
||||
void disable() override
|
||||
{
|
||||
enabled = false;
|
||||
this->onStop();
|
||||
|
||||
mBluetoothServer = nullptr;
|
||||
mServiceDiscoveryAgent = nullptr;
|
||||
}
|
||||
void disable() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void onNetworkChange() override;
|
||||
|
|
|
@ -84,6 +84,17 @@ LanLinkProvider::~LanLinkProvider()
|
|||
{
|
||||
}
|
||||
|
||||
void LanLinkProvider::enable()
|
||||
{
|
||||
disabled = false;
|
||||
this->onStart();
|
||||
}
|
||||
void LanLinkProvider::disable()
|
||||
{
|
||||
this->onStop();
|
||||
disabled = true;
|
||||
}
|
||||
|
||||
void LanLinkProvider::onStart()
|
||||
{
|
||||
const QHostAddress bindAddress = m_testMode ? QHostAddress::LocalHost : QHostAddress::Any;
|
||||
|
|
|
@ -43,12 +43,8 @@ public:
|
|||
return 20;
|
||||
}
|
||||
|
||||
void enable() override
|
||||
{
|
||||
}
|
||||
void disable() override
|
||||
{
|
||||
}
|
||||
void enable() override;
|
||||
void disable() override;
|
||||
|
||||
void sendUdpIdentityPacket(const QList<QHostAddress> &addresses);
|
||||
|
||||
|
@ -99,6 +95,8 @@ private:
|
|||
const bool m_testMode;
|
||||
QTimer m_combineNetworkChangeTimer;
|
||||
|
||||
bool disabled;
|
||||
|
||||
#ifdef KDECONNECT_MDNS
|
||||
MdnsDiscovery m_mdnsDiscovery;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue