Prepare for msgs downloading.

This commit is contained in:
Martin Rotter 2017-09-26 22:14:59 +02:00
parent 1dbc2507df
commit 0fbe57b921
3 changed files with 10 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "services/inoreader/inoreaderserviceroot.h"
#include "services/inoreader/network/inoreadernetworkfactory.h"
InoreaderFeed::InoreaderFeed(RootItem* parent) : Feed(parent) {}
@ -31,5 +32,7 @@ InoreaderServiceRoot* InoreaderFeed::serviceRoot() const {
}
QList<Message> InoreaderFeed::obtainNewMessages(bool* error_during_obtaining) {
return QList<Message>();
QList<Message> messages = serviceRoot()->network()->messages(customId(), error_during_obtaining);
return messages;
}

View File

@ -101,6 +101,8 @@ RootItem* InoreaderNetworkFactory::feedsCategories(bool obtain_icons) {
return decodeFeedCategoriesData(category_data, feed_data, obtain_icons);
}
QList<Message> InoreaderNetworkFactory::messages(const QString& stream_id, bool* is_error) {}
RootItem* InoreaderNetworkFactory::decodeFeedCategoriesData(const QString& categories, const QString& feeds, bool obtain_icons) {
RootItem* parent = new RootItem();
QJsonArray json = QJsonDocument::fromJson(categories.toUtf8()).object()["tags"].toArray();

View File

@ -21,6 +21,8 @@
#include <QObject>
#include "core/message.h"
#include <QNetworkReply>
class RootItem;
@ -46,6 +48,8 @@ class InoreaderNetworkFactory : public QObject {
// Returned items do not have primary IDs assigned.
RootItem* feedsCategories(bool obtain_icons);
QList<Message> messages(const QString& stream_id, bool* is_error);
private:
RootItem* decodeFeedCategoriesData(const QString& categories, const QString& feeds, bool obtain_icons);