mirror of
https://invent.kde.org/network/kdeconnect-kde.git
synced 2026-11-01 15:11:05 +01:00
The class for the Bluetooth link provider we used was called `AsyncLinkProvider`, which in turn wrapped the `BluetoothLinkProvider` class. This renames `AsyncLinkProvider` to `BluetoothLinkProvider` and turns what was `BluetoothLinkProvider` into `BluetoothLinkProviderImpl`. This change also makes `BluetoothLinkProviderImpl` not a `LinkProvider` itself, since it's never used standalone so it doesn't need to implement that interface. It also renames `name()` to `id()` for all providers, to avoid confusion with `displayName()`. I also went ahead and simplified the provider IDs to just "lan", or "bluetooth" instead of "LanLinkProvider" or "BluetoothLinkProvider", since users need to pass those IDs to enable/disable them from the command line. Because of that, I also renamed the setting named `disabled_providers` to `disabled_providers_v2`, since all the previously stored ids are no longer valid which would suddenly enable all providers. This resets the config for all users to the default selection, with only LAN enabled.
59 lines
1.0 KiB
C++
59 lines
1.0 KiB
C++
/**
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
*/
|
|
|
|
#ifndef DEVICELINK_H
|
|
#define DEVICELINK_H
|
|
|
|
#include <QObject>
|
|
|
|
#include "deviceinfo.h"
|
|
#include "networkpacket.h"
|
|
|
|
class LinkProvider;
|
|
|
|
class DeviceLink : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
DeviceLink(const QString &deviceId, LinkProvider *parent);
|
|
|
|
QString deviceId() const
|
|
{
|
|
return deviceInfo().id;
|
|
}
|
|
|
|
int priority() const
|
|
{
|
|
return priorityFromProvider;
|
|
}
|
|
|
|
QString provider() const
|
|
{
|
|
return idFromProvider;
|
|
}
|
|
|
|
QString providerName() const
|
|
{
|
|
return displayidFromProvider;
|
|
}
|
|
|
|
virtual bool sendPacket(NetworkPacket &np) = 0;
|
|
|
|
virtual DeviceInfo deviceInfo() const = 0;
|
|
|
|
virtual QString address() const = 0;
|
|
|
|
private:
|
|
int priorityFromProvider;
|
|
QString idFromProvider;
|
|
QString displayidFromProvider;
|
|
|
|
Q_SIGNALS:
|
|
void receivedPacket(const NetworkPacket &np);
|
|
};
|
|
|
|
#endif
|