Merge additions to common from Sailfish UI
This commit is contained in:
parent
2f291673ab
commit
c1f8db5500
2 changed files with 15 additions and 0 deletions
|
@ -29,6 +29,8 @@ Python {
|
|||
signal downloading(int episode_id)
|
||||
signal downloadProgress(int episode_id, real progress)
|
||||
signal downloaded(int episode_id)
|
||||
signal deleted(int episode_id)
|
||||
signal isNewChanged(int episode_id, bool is_new)
|
||||
|
||||
Component.onCompleted: {
|
||||
setHandler('hello', function (version, copyright) {
|
||||
|
@ -39,6 +41,8 @@ Python {
|
|||
setHandler('downloading', py.downloading);
|
||||
setHandler('download-progress', py.downloadProgress);
|
||||
setHandler('downloaded', py.downloaded);
|
||||
setHandler('deleted', py.deleted);
|
||||
setHandler('is-new-changed', py.isNewChanged);
|
||||
|
||||
var path = Qt.resolvedUrl('../..').substr('file://'.length);
|
||||
addImportPath(path);
|
||||
|
|
|
@ -31,3 +31,14 @@ function updateModelFrom(model, data) {
|
|||
model.remove(model.count-1);
|
||||
}
|
||||
}
|
||||
|
||||
function updateModelWith(model, key, value, update) {
|
||||
for (var row=0; row<model.count; row++) {
|
||||
var current = model.get(row);
|
||||
if (current[key] == value) {
|
||||
for (var key in update) {
|
||||
model.setProperty(row, key, update[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue