Mark QOfonoModem and other objects invalid if modem goes away #85

Merged
merged 1 commit into from Sep 17, 2015

Conversation

Projects
None yet
2 participants
Contributor

monich commented Sep 15, 2015

This allows UI to behave reasonably when the modems get added/removed dynamically (or ofono crashes).

Similarly, connection context is marked invalid when SIM is removed.

The ValidTracker mechanism eliminates unnecessary validChanged() signals.

src/qofonomodem.cpp
{
+ QOfonoManager* mgr = privateData()->mgr.data();
+ connect(mgr, SIGNAL(availableChanged(bool)), SLOT(onManagerAvailableChanged(bool)));
+ connect(mgr, SIGNAL(modemsChanged(QStringList)), SLOT(onModemsChanged(QStringList)));
@amccarthy

amccarthy Sep 16, 2015

Member

There is no need to define these two private slots which just call checkModemPathValidity(). The slots can have fewer parameters than the signal. Make checkModemPathValidity() a slot and connect to the signals directy.

Contributor

monich commented Sep 16, 2015

Short circuited signals to checkModemPathValidity() handler per review suggestion, eliminating unnecessary slots.

Contributor

monich commented Sep 17, 2015

Any more objections or comments?

Member

amccarthy commented Sep 17, 2015

LGTM

monich added a commit that referenced this pull request Sep 17, 2015

Merge pull request #85 from monich/modempath
Mark QOfonoModem and other objects invalid if modem goes away

@monich monich merged commit 98b5e4c into nemomobile:master Sep 17, 2015

@monich monich deleted the monich:modempath branch Sep 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment