models: Move QML Connections to separate objects
This commit is contained in:
parent
deaa5e8268
commit
77bac09899
7 changed files with 108 additions and 60 deletions
|
@ -30,31 +30,4 @@ ListModel {
|
|||
Util.updateModelFrom(podcastListModel, podcasts);
|
||||
});
|
||||
}
|
||||
|
||||
property var connections: Connections {
|
||||
target: py
|
||||
|
||||
onPodcastListChanged: {
|
||||
podcastListModel.reload();
|
||||
}
|
||||
|
||||
onUpdatingPodcast: {
|
||||
for (var i=0; i<podcastListModel.count; i++) {
|
||||
var podcast = podcastListModel.get(i);
|
||||
if (podcast.id == podcast_id) {
|
||||
podcastListModel.setProperty(i, 'updating', true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onUpdatedPodcast: {
|
||||
for (var i=0; i<podcastListModel.count; i++) {
|
||||
if (podcastListModel.get(i).id == podcast.id) {
|
||||
podcastListModel.set(i, podcast);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue