~ci-train-bot/indicator-network/indicator-network-ubuntu-zesty-2120

« back to all changes in this revision

Viewing changes to src/indicator/nmofono/kill-switch.cpp

Don't require urfkill, and handle flight mode gracefully when not present

Approved by: Ted Gould

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
                                                                                 systemBus);
104
104
 
105
105
    d = make_unique<Private>(*this, urfkill, killSwitch);
106
 
    d->setFlightMode(urfkill->IsFlightMode());
 
106
    auto reply = urfkill->IsFlightMode();
 
107
    reply.waitForFinished();
 
108
    qDebug() << Q_FUNC_INFO << "reply.isValid()" << reply.isValid() << "reply.value()" << reply.value() << "reply.error()" << reply.error();
 
109
    d->setFlightMode(reply.isValid() ? reply.value() : false);
107
110
    d->stateChanged();
108
111
 
109
112
    connect(urfkill.get(), &OrgFreedesktopURfkillInterface::FlightModeChanged, d.get(), &Private::setFlightMode);