API does not follow QML style
Bug #1393261 reported by
Michael Zanetti
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical System Image |
Fix Released
|
Undecided
|
Unassigned | ||
ubuntu-push-qml (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The PushClient API does not have parameter names, which causes troubles using it in a QML like manner:
Usually in QML one would use the PushClient like this:
PushClient {
onError: {
print(
}
}
However, due to the fact that the error() signal is declared as "void error(QString)" instead of "void error(QString error)" this is not possible and the above code results in printing the function pointer to the error function.
Also, for performance reasons, non-basic parameters should be changed to use const &, like
void error(const QString &error)
This affects all signals of the PushClient class.
Related branches
lp:~mzanetti/ubuntu-push-qml/constify-reference-name-parameters
- Michał Karnicki (community): Approve
- John Lenton (community): Approve
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 72 lines (+13/-13)2 files modifiedsrc/Ubuntu/PushNotifications/pushclient.cpp (+3/-3)
src/Ubuntu/PushNotifications/pushclient.h (+10/-10)
Changed in ubuntu-push: | |
importance: | Undecided → High |
assignee: | nobody → John Lenton (chipaca) |
no longer affects: | ubuntu-push |
Changed in canonical-devices-system-image: | |
status: | New → Fix Released |
To post a comment you must log in.
After this change, the example in here [1] can be updated to use the QML style of doing things, which also has the advantage that it allows removing the undefined reference to messageList from the example code.
[1] http:// developer. ubuntu. com/apps/ platform/ guides/ push-notificati ons-client- guide/