mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
solid-networkstatus: deal with TODO related to connman status
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8dd5790803
commit
93f0db83f4
1 changed files with 9 additions and 3 deletions
|
@ -65,12 +65,18 @@ void ConnmanStatus::connmanStateChanged()
|
|||
if (!reply.isValid()) {
|
||||
kWarning() << "invalid reply" << reply.error().message();
|
||||
} else {
|
||||
// TODO: not implemented: Disconnecting, Connecting (match to ready?)
|
||||
const ConnmanPropertiesType props = reply.value();
|
||||
const QString state = props.value("State").toString();
|
||||
if (state == QLatin1String("online")) {
|
||||
// for reference:
|
||||
// https://git.kernel.org/pub/scm/network/connman/connman.git/tree/doc/overview-api.txt
|
||||
if (state == QLatin1String("ready") || state == QLatin1String("association")
|
||||
|| state == QLatin1String("configuration")) {
|
||||
m_status = Solid::Networking::Connecting;
|
||||
} else if (state == QLatin1String("online")) {
|
||||
m_status = Solid::Networking::Connected;
|
||||
} else if (state == QLatin1String("offline")) {
|
||||
} else if (state == QLatin1String("disconnect")) {
|
||||
m_status = Solid::Networking::Disconnecting;
|
||||
} else if (state == QLatin1String("offline") || state == QLatin1String("idle")) {
|
||||
m_status = Solid::Networking::Unconnected;
|
||||
} else {
|
||||
kWarning() << "unknown state" << state;
|
||||
|
|
Loading…
Add table
Reference in a new issue