diff --git a/touch/EpisodesPage.qml b/touch/EpisodesPage.qml index 7e0f128..9c49ce4 100644 --- a/touch/EpisodesPage.qml +++ b/touch/EpisodesPage.qml @@ -2,7 +2,7 @@ /** * * gPodder QML UI Reference Implementation - * Copyright (c) 2013, Thomas Perl + * Copyright (c) 2013, 2014, Thomas Perl * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,6 +20,7 @@ import QtQuick 2.0 +import 'common' import 'common/util.js' as Util SlidePage { @@ -33,11 +34,7 @@ SlidePage { width: parent.width height: parent.height - Component.onCompleted: { - py.call('main.load_episodes', [podcast_id], function (episodes) { - Util.updateModelFrom(episodeListModel, episodes); - }); - } + Component.onCompleted: episodeListModel.loadEpisodes(podcast_id); PullMenu { PullMenuItem { @@ -60,7 +57,7 @@ SlidePage { PListView { id: episodeList title: episodesPage.title - model: ListModel { id: episodeListModel } + model: GPodderEpisodeListModel { id: episodeListModel } delegate: EpisodeItem { onClicked: pgst.loadPage('EpisodeDetail.qml', {episode_id: id, title: title}); diff --git a/touch/PodcastsPage.qml b/touch/PodcastsPage.qml index adbdfa3..fa062fa 100644 --- a/touch/PodcastsPage.qml +++ b/touch/PodcastsPage.qml @@ -20,50 +20,14 @@ import QtQuick 2.0 +import 'common' import 'common/util.js' as Util SlidePage { id: podcastsPage hasPull: true - function reload() { - loading.visible = true; - py.call('main.load_podcasts', [], function (podcasts) { - Util.updateModelFrom(podcastListModel, podcasts); - loading.visible = false; - }); - } - - Component.onCompleted: { - reload(); - - py.setHandler('podcast-list-changed', podcastsPage.reload); - - py.setHandler('updating-podcast', function (podcast_id) { - for (var i=0; i