Merge lp://staging/~abreu-alexandre/unity-webapps-qml/application-api into lp://staging/unity-webapps-qml
Proposed by
Alexandre Abreu
Status: | Merged |
---|---|
Merged at revision: | 102 |
Proposed branch: | lp://staging/~abreu-alexandre/unity-webapps-qml/application-api |
Merge into: | lp://staging/unity-webapps-qml |
Diff against target: |
1421 lines (+1185/-9) 20 files modified
examples/api-bindings/alarm/www/index.html (+4/-0) examples/api-bindings/content-hub-exporter/www/index.html (+4/-0) examples/api-bindings/content-hub/www/index.html (+4/-0) examples/api-bindings/online-accounts/www/index.html (+4/-0) examples/api-bindings/runtime-api/main.qml.in (+32/-0) examples/api-bindings/runtime-api/www/index.html (+22/-0) examples/api-bindings/runtime-api/www/js/app.js (+57/-0) src/Ubuntu/UnityWebApps/UnityWebApps.pro (+22/-7) src/Ubuntu/UnityWebApps/UnityWebApps.qml (+3/-0) src/Ubuntu/UnityWebApps/bindings/runtime-api/backend/runtime-api.js (+171/-0) src/Ubuntu/UnityWebApps/bindings/runtime-api/client/runtime-api.js (+256/-0) src/Ubuntu/UnityWebApps/plugin/application-api.cpp (+287/-0) src/Ubuntu/UnityWebApps/plugin/application-api.h (+75/-0) src/Ubuntu/UnityWebApps/plugin/application-signal-to-qt-bridge.cpp (+139/-0) src/Ubuntu/UnityWebApps/plugin/application-signal-to-qt-bridge.h (+62/-0) src/Ubuntu/UnityWebApps/plugin/plugin.pro (+6/-2) src/Ubuntu/UnityWebApps/plugin/qml-plugin.cpp (+15/-0) src/Ubuntu/UnityWebApps/unity-webapps-api.js.in (+2/-0) tests/unit/test_plugin/tst_plugin.cpp (+19/-0) tests/unit/test_plugin/tst_plugin.h (+1/-0) |
To merge this branch: | bzr merge lp://staging/~abreu-alexandre/unity-webapps-qml/application-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Mardegan (community) | Needs Fixing | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+212727@code.staging.launchpad.net |
Commit message
Add application api
Description of the change
Add application api
To post a comment you must log in.
I tested it and it's mostly working. A few comments:
getPlatformInfos: I think it's better to call it "getPlatformInfo" without the final "s". Anyway, this just returns the name of the QPA plugin, so I'd rather rename the method to "getPlatformName" or keep the current name and make it return a dictionary, currently having only one field "name" which contains the platform name. But I'd take the second approach only if you really plan to add more info there in the future.
The example expects the onActivated() and onDeactivated() signal to carry a parameter, but they don't.
All the methods are asynchronous and take a callback; even the applicationName() function is asynchronous, even if the result is immediately available. I'm not familiar with HTML5 development so this might be perfectly fine, I just point this out because coming from the C++ world this sounds rather strange (and a bit inconvenient).
Naming: it's better to use the same convention for all the getters: either start their name always with a "get", or never. Most of the methods you added start with "get", but "applicationName" doesn't.
getInputMethod(): it's not very clear what this function does; maybe rename it to "getInputMethod Name"?
nameFromScreenO rientation( ): you are only use two possible values, "Landscape" and "Portrait", while Qt supports 4. I guess that most apps don't care about distinguishing between the extra modes, but maybe some do (to be sure that the mic is on a specific side, for instance)?