Provide default implementation for KdeConnectPlugin::connected

In most plugins, we just provided a dummy implementation
This commit is contained in:
Alexander Lohnau 2023-07-22 09:41:50 +02:00 committed by Albert Vaca Cintora
parent 7b15a5eab7
commit e97af9dc15
30 changed files with 3 additions and 78 deletions

View file

@ -52,7 +52,9 @@ public Q_SLOTS:
* This method will be called when a device is connected to this computer.
* The plugin could be loaded already, but there is no guarantee we will be able to reach the device until this is called.
*/
virtual void connected() = 0;
virtual void connected()
{
}
private:
QScopedPointer<KdeConnectPluginPrivate> d;

View file

@ -21,7 +21,6 @@ public:
explicit BigscreenPlugin(QObject *parent, const QVariantList &args);
bool receivePacket(const NetworkPacket &np) override;
void connected() override{};
QString dbusPath() const override;
Q_SIGNALS:

View file

@ -30,10 +30,6 @@ int ConnectivityReportPlugin::cellularNetworkStrength() const
return m_cellularNetworkStrength;
}
void ConnectivityReportPlugin::connected()
{
}
bool ConnectivityReportPlugin::receivePacket(const NetworkPacket &np)
{
if (PACKET_TYPE_CONNECTIVITY_REPORT != np.type()) {

View file

@ -43,7 +43,6 @@ public:
explicit ConnectivityReportPlugin(QObject *parent, const QVariantList &args);
bool receivePacket(const NetworkPacket &np) override;
void connected() override;
QString dbusPath() const override;
QString cellularNetworkType() const;

View file

@ -24,9 +24,6 @@ public:
Q_SCRIPTABLE void ring();
QString dbusPath() const override;
void connected() override
{
}
bool receivePacket(const NetworkPacket &np) override;
};

View file

@ -31,7 +31,6 @@ class FindThisDevicePlugin : public KdeConnectPlugin
public:
explicit FindThisDevicePlugin(QObject *parent, const QVariantList &args);
void connected() override{};
QString dbusPath() const override;
bool receivePacket(const NetworkPacket &np) override;
};

View file

@ -39,9 +39,6 @@ public:
~MMTelephonyPlugin() override = default;
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
private:
void onCallAdded(ModemManager::Call::Ptr call);

View file

@ -34,9 +34,6 @@ public:
explicit MprisControlPlugin(QObject *parent, const QVariantList &args);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
private:
std::optional<GlobalSystemMediaTransportControlsSessionManager> sessionManager;

View file

@ -53,9 +53,6 @@ public:
explicit MprisControlPlugin(QObject *parent, const QVariantList &args);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
private Q_SLOTS:
void propertiesChanged(const QString &propertyInterface, const QVariantMap &properties);

View file

@ -50,9 +50,6 @@ public:
void setPlayer(const QString &player);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override;
Q_SCRIPTABLE void seek(int offset) const;

View file

@ -35,9 +35,6 @@ public:
~PauseMusicPlugin();
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
private:
void updatePlayersList();

View file

@ -21,9 +21,6 @@ public:
explicit PauseMusicPlugin(QObject *parent, const QVariantList &args);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
private:
QSet<QString> pausedSources;

View file

@ -25,9 +25,6 @@ public:
Q_SCRIPTABLE void requestPhoto(const QString &url);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override;

View file

@ -26,10 +26,6 @@ public:
Q_SCRIPTABLE void sendPing(const QString &customMessage);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override;
};

View file

@ -25,9 +25,6 @@ class Q_DECL_EXPORT PresenterPlugin : public KdeConnectPlugin
public:
explicit PresenterPlugin(QObject *parent, const QVariantList &args);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
private:
QPointer<PresenterView> m_view;

View file

@ -25,9 +25,6 @@ public:
{
return false;
}
void connected() override
{
}
QString dbusPath() const override;
Q_SCRIPTABLE void moveCursor(const QPoint &p);

View file

@ -121,10 +121,6 @@ int RemoteKeyboardPlugin::translateQtKey(int qtKey) const
return specialKeysMap.value(qtKey, 0);
}
void RemoteKeyboardPlugin::connected()
{
}
QString RemoteKeyboardPlugin::dbusPath() const
{
return QStringLiteral("/modules/kdeconnect/devices/") + device()->id() + QStringLiteral("/remotekeyboard");

View file

@ -31,7 +31,6 @@ public:
bool receivePacket(const NetworkPacket &np) override;
QString dbusPath() const override;
void connected() override;
bool remoteState() const
{

View file

@ -33,10 +33,6 @@ ScreensaverInhibitPlugin::~ScreensaverInhibitPlugin()
}
}
void ScreensaverInhibitPlugin::connected()
{
}
bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket &np)
{
Q_UNUSED(np);

View file

@ -21,7 +21,6 @@ public:
~ScreensaverInhibitPlugin() override;
bool receivePacket(const NetworkPacket &np) override;
void connected() override;
private:
QProcess *m_caffeinateProcess;

View file

@ -20,7 +20,6 @@ public:
~ScreensaverInhibitPlugin() override;
bool receivePacket(const NetworkPacket &np) override;
void connected() override{};
};
#endif

View file

@ -42,10 +42,6 @@ ScreensaverInhibitPlugin::~ScreensaverInhibitPlugin()
inhibitInterface.SimulateUserActivity();
}
void ScreensaverInhibitPlugin::connected()
{
}
bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket &np)
{
Q_UNUSED(np);

View file

@ -20,7 +20,6 @@ public:
~ScreensaverInhibitPlugin() override;
bool receivePacket(const NetworkPacket &np) override;
void connected() override;
private:
uint inhibitCookie;

View file

@ -30,8 +30,4 @@ bool SendNotificationsPlugin::receivePacket(const NetworkPacket &np)
return true;
}
void SendNotificationsPlugin::connected()
{
}
#include "sendnotificationsplugin.moc"

View file

@ -28,7 +28,6 @@ public:
~SendNotificationsPlugin() override;
bool receivePacket(const NetworkPacket &np) override;
void connected() override;
protected:
NotificationsListener *notificationsListener;

View file

@ -24,9 +24,6 @@ public:
explicit SftpPlugin(QObject *parent, const QVariantList &args);
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override
{
return QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/sftp");

View file

@ -22,9 +22,6 @@ public:
~SftpPlugin() override;
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override
{
return QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/sftp");

View file

@ -36,9 +36,6 @@ public:
}
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override;
private Q_SLOTS:

View file

@ -148,9 +148,6 @@ public:
~SmsPlugin() override;
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override;

View file

@ -40,9 +40,6 @@ public:
~TelephonyPlugin() override = default;
bool receivePacket(const NetworkPacket &np) override;
void connected() override
{
}
QString dbusPath() const override;
public: