Add new stateChanged() signal to active connection
Needs ReviewPublic

Authored by jgrulich on Jun 6 2017, 11:45 AM.

Details

Reviewers
lvsouza
Summary

There is a new additional StateChanged() signal coming from NetworkManager with additional reason property so
with that we can now check what was the reason for the changed state. Use this new signal when NM 1.8.0 is present
and emit also the old one for backward compatibility.

There is just one minor problem, with two stateChanged() signals you will need to specify to which signal you want
to connect to when using Qt5 syntax for signals/slots and without that you won't compile current code, i.e. of plasma-nm

Diff Detail

Repository
R282 NetworkManagerQt
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
jgrulich created this revision.Jun 6 2017, 11:45 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJun 6 2017, 11:45 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript

There is just one minor problem, with two stateChanged() signals you will need to specify to which signal you want
to connect to when using Qt5 syntax for signals/slots and without that you won't compile current code, i.e. of plasma-nm

I think we're going to have to treat overloading signals as an API break. Current plasma needs to compile with new frameworks.

There's a line in the Qt wiki page that implies they now have that policy.

"… but we have been adding overloads in past minor releases of Qt because taking the address of a function was not a use case we support. But now this would be impossible without breaking the source compatibility. "

can you find a new signal name and emit both for compatibility?

anthonyfieroni added inline comments.
src/activeconnection.h
77 ↗(On Diff #15210)

All others are composed <-- real reason --> ## Reason, but this :)

....

can you find a new signal name and emit both for compatibility?

What would you suggest? I can think of stateChangedWithReason() or stateChangedWithKnownReason() or something like that.

jgrulich updated this revision to Diff 15564.Jun 19 2017, 8:36 AM

Fix enum name and avoid ABI breakage with overriden signal

jgrulich updated this revision to Diff 15566.Jun 19 2017, 8:39 AM

Revert unwanted change