Remove requestSinks from SystemVolume plugin

Sinks are sent at connect time and updated as necessary, so drop
the request command.

See: https://invent.kde.org/network/kdeconnect-meta/-/merge_requests/8
This commit is contained in:
Andy Holmes 2024-11-14 14:13:21 -08:00
parent daf09c61d8
commit ad7d3dd964
No known key found for this signature in database
5 changed files with 47 additions and 67 deletions

View file

@ -56,13 +56,6 @@ void RemoteSystemVolumePlugin::sendMuted(const QString &name, bool muted)
sendPacket(np);
}
void RemoteSystemVolumePlugin::connected()
{
NetworkPacket np(PACKET_TYPE_SYSTEMVOLUME_REQUEST);
np.set<bool>(QStringLiteral("requestSinks"), true);
sendPacket(np);
}
QByteArray RemoteSystemVolumePlugin::sinks()
{
return m_sinks;

View file

@ -24,7 +24,6 @@ public:
using KdeConnectPlugin::KdeConnectPlugin;
void receivePacket(const NetworkPacket &np) override;
void connected() override;
QString dbusPath() const override;
QString deviceId() const

View file

@ -221,9 +221,6 @@ SystemvolumePlugin::~SystemvolumePlugin()
void SystemvolumePlugin::receivePacket(const NetworkPacket &np)
{
if (np.has(QStringLiteral("requestSinks"))) {
sendSinkList();
} else {
QString name = np.get<QString>(QStringLiteral("name"));
if (m_sinksMap.contains(name)) {
@ -238,7 +235,6 @@ void SystemvolumePlugin::receivePacket(const NetworkPacket &np)
}
}
}
}
void SystemvolumePlugin::sendSinkList()
{

View file

@ -33,9 +33,6 @@ void SystemvolumePlugin::receivePacket(const NetworkPacket &np)
if (!PulseAudioQt::Context::instance()->isValid())
return;
if (np.has(QStringLiteral("requestSinks"))) {
sendSinkList();
} else {
QString name = np.get<QString>(QStringLiteral("name"));
PulseAudioQt::Sink *sink = sinksMap.value(name);
@ -53,7 +50,6 @@ void SystemvolumePlugin::receivePacket(const NetworkPacket &np)
}
}
}
}
void SystemvolumePlugin::sendSinkList()
{

View file

@ -404,9 +404,6 @@ void SystemvolumePlugin::receivePacket(const NetworkPacket &np)
if (!valid)
return;
if (np.has(QStringLiteral("requestSinks"))) {
sendSinkList();
} else {
QString name = np.get<QString>(QStringLiteral("name"));
auto sinkListIterator = this->sinkList.find(name);
@ -439,7 +436,6 @@ void SystemvolumePlugin::receivePacket(const NetworkPacket &np)
}
}
}
}
#include "moc_systemvolumeplugin-win.cpp"
#include "systemvolumeplugin-win.moc"