Commit 5d6050bf authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Make two calls synchronous and also make

RemoteActivatable::activatableType() return a sane default in case of
errors.

activatableType() was returning
Knm::Activatable::WirelessInterfaceConnection in case of error or when
the assynchronous DBus call returned before the real value was
available, which led to a crash in applet/wirelessstatus.cpp when the
real activatable type was not WirelessInterfaceConnection ot
WirelessNetwork.

BUG: 283241
FIXED-IN: 0.9.0
(cherry picked from commit ca33e27e)
parent 0e87ab1a
......@@ -57,14 +57,21 @@ RemoteActivatable::~RemoteActivatable()
Knm::Activatable::ActivatableType RemoteActivatable::activatableType() const
{
Q_D(const RemoteActivatable);
uint aType = d->activatableIface->activatableType();
return (Knm::Activatable::ActivatableType)aType;
QDBusReply<uint> reply = d->activatableIface->activatableType();
if (reply.isValid()) {
return (Knm::Activatable::ActivatableType)reply.value();
}
return Knm::Activatable::InterfaceConnection;
}
QString RemoteActivatable::deviceUni() const
{
Q_D(const RemoteActivatable);
return d->activatableIface->deviceUni();
QDBusReply<QString> reply = d->activatableIface->activatableType();
if (reply.isValid()) {
return reply.value();
}
return QString();
}
void RemoteActivatable::activate()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment