From 300643918a82a9c22dde0da875291bfbcd014eb9 Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Sun, 2 Feb 2014 16:08:55 +0100 Subject: [PATCH] Desktop UI: Use common podcast and episode list model --- desktop/gpodder.qml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/desktop/gpodder.qml b/desktop/gpodder.qml index cac92ac..11836ab 100644 --- a/desktop/gpodder.qml +++ b/desktop/gpodder.qml @@ -16,9 +16,7 @@ ApplicationWindow { onReadyChanged: { if (ready) { - py.call('main.load_podcasts', [], function (podcasts) { - Util.updateModelFrom(podcastListModel, podcasts); - }); + podcastListModel.reload(); } } } @@ -32,7 +30,7 @@ ApplicationWindow { TableView { width: 200 - model: ListModel { id: podcastListModel } + model: GPodderPodcastListModel { id: podcastListModel } headerVisible: false alternatingRowColors: false @@ -72,15 +70,13 @@ ApplicationWindow { onCurrentRowChanged: { var id = podcastListModel.get(currentRow).id; - py.call('main.load_episodes', [id], function (episodes) { - Util.updateModelFrom(episodeListModel, episodes); - }); + episodeListModel.loadEpisodes(id); } } TableView { Layout.fillWidth: true - model: ListModel { id: episodeListModel } + model: GPodderEpisodeListModel { id: episodeListModel } TableViewColumn { role: 'title'; title: 'Title' } }