KUnifiedPush
distributor.cpp
36 connect(QNetworkInformation::instance(), &QNetworkInformation::reachabilityChanged, this, &Distributor::processNextCommand);
38 qCWarning(Log) << "No network state information available!" << QNetworkInformation::availableBackends();
46 QDBusConnection::sessionBus().registerObject(QLatin1String(KDE_DISTRIBUTOR_MANAGEMENT_PATH), this);
56 const auto clientTokens = settings.value(QStringLiteral("Clients/Tokens"), QStringList()).toStringList();
85QString Distributor::Register(const QString& serviceName, const QString& token, const QString &description, QString& registrationResultReason)
95 // this can involve first-time device registration that is a prerequisite for registering clients
155void Distributor::clientRegistered(const Client &client, AbstractPushProvider::Error error, const QString &errorMsg)
196 client.connector().Unregistered(m_currentCommand.type == Command::Unregister ? QString() : client.token);
237void Distributor::providerDisconnected(AbstractPushProvider::Error error, const QString &errorMsg)
253 std::transform(m_clients.begin(), m_clients.end(), std::back_inserter(l), [](const auto &client) { return client.token; });
285 connect(m_pushProvider.get(), &AbstractPushProvider::messageReceived, this, &Distributor::messageReceived);
286 connect(m_pushProvider.get(), &AbstractPushProvider::clientRegistered, this, &Distributor::clientRegistered);
287 connect(m_pushProvider.get(), &AbstractPushProvider::clientUnregistered, this, &Distributor::clientUnregistered);
288 connect(m_pushProvider.get(), &AbstractPushProvider::connected, this, &Distributor::providerConnected);
289 connect(m_pushProvider.get(), &AbstractPushProvider::disconnected, this, &Distributor::providerDisconnected);
295 QStringList activatableServiceNames = QDBusConnection::sessionBus().interface()->activatableServiceNames();
301 if (!std::binary_search(activatableServiceNames.begin(), activatableServiceNames.end(), client.serviceName)) {
413 // if push provider or config changed: unregister all clients, create new push provider backend, re-register all clients
502 return reachability == QNetworkInformation::Reachability::Online || reachability == QNetworkInformation::Reachability::Unknown;
void messageReceived(const KUnifiedPush::Message &msg)
Inform about a received push notification.
void connected()
Emitted after the connection to the push provider has been established successfully.
void clientUnregistered(const KUnifiedPush::Client &client, KUnifiedPush::AbstractPushProvider::Error error=NoError)
Emitted after successful client unregistration.
void disconnected(KUnifiedPush::AbstractPushProvider::Error error, const QString &errorMsg={})
Emitted after the connection to the push provider disconnected or failed to be established.
void clientRegistered(const KUnifiedPush::Client &client, KUnifiedPush::AbstractPushProvider::Error error=NoError, const QString &errorMsg={})
Emitted after successful client registration.
@ ProviderRejected
communication worked, but the provider refused to complete the operation
Definition abstractpushprovider.h:31
OrgUnifiedpushConnector1Interface connector() const
D-Bus UnifiedPush connector interface.
Definition client.cpp:52
Push provider protocol implementation for Gotify.
Definition gotifypushprovider.h:19
NextPush push provider implementation.
Definition nextpushprovider.h:24
Q_SCRIPTABLE CaptureState status()
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QDBusConnectionInterface * interface() const const
bool registerObject(const QString &path, QObject *object, RegisterOptions options)
bool send(const QDBusMessage &message) const const
QDBusConnection sessionBus()
activatableServiceNames
const QDBusMessage & message() const const
void setDelayedReply(bool enable) const const
InvalidMessage
QDBusMessage createReply(const QList< QVariant > &arguments) const const
MessageType type() const const
iterator begin()
iterator end()
void push_back(parameter_type value)
void reserve(qsizetype size)
QStringList availableBackends()
QNetworkInformation * instance()
bool loadBackendByFeatures(Features features)
void reachabilityChanged(Reachability newReachability)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QStringList allKeys() const const
void beginGroup(QAnyStringView prefix)
void endGroup()
void remove(QAnyStringView key)
void setValue(QAnyStringView key, const QVariant &value)
QVariant value(QAnyStringView key) const const
void clear()
QString fromLatin1(QByteArrayView str)
bool isEmpty() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QString toString() const const
QStringList toStringList() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.