diff --git a/src/api/newsfeed.cpp b/src/api/newsfeed.cpp index cc69981..ca88c1d 100644 --- a/src/api/newsfeed.cpp +++ b/src/api/newsfeed.cpp @@ -79,30 +79,30 @@ class NewsFeedPrivate void _q_news_received(const QVariant &response) { - Q_Q(NewsFeed); - auto map = response.toMap(); + Q_Q(NewsFeed); + auto map = response.toMap(); updateProfiles(map.value("profiles").toList()); updateGroups(map.value("groups").toList()); - auto items = map.value("items").toList(); - NewsItemList news; - foreach (auto item, items) { - auto newsItem = NewsItem::fromData(item); - auto map = item.toMap(); + auto items = map.value("items").toList(); + NewsItemList news; + foreach (auto item, items) { + auto newsItem = NewsItem::fromData(item); + auto map = item.toMap(); auto itemCount = strCount(filters_str); - for (size_t i = 0; i != itemCount; i++) { - auto list = map.value(filters_str[i]).toList(); - if (list.count()) { - auto count = list.takeFirst().toInt(); - Q_UNUSED(count); - newsItem.setAttachments(Attachment::fromVariantList(list)); - break; - } - } - news.append(newsItem); - } - emit q->newsRecieved(news); - } + for (size_t i = 0; i != itemCount; i++) { + auto list = map.value(filters_str[i]).toList(); + if (list.count()) { + auto count = list.takeFirst().toInt(); + Q_UNUSED(count); + newsItem.setAttachments(Attachment::fromVariantList(list)); + break; + } + } + news.append(newsItem); + } + emit q->newsReceived(news); + } }; /*! @@ -137,7 +137,7 @@ Reply *NewsFeed::getNews(Filters filters, quint8 count, int offset) args.insert("filters", flagsToStrList(filters, filters_str).join(",")); args.insert("offset", offset); - auto reply = d_func()->client->request("newsfeed.get", args); + auto reply = d_func()->client->request("newsfeed.get", args); connect(reply, SIGNAL(resultReady(QVariant)), SLOT(_q_news_received(QVariant))); return reply; } diff --git a/src/api/newsfeed.h b/src/api/newsfeed.h index 4c96008..008b0e4 100644 --- a/src/api/newsfeed.h +++ b/src/api/newsfeed.h @@ -54,9 +54,9 @@ class VK_SHARED_EXPORT NewsFeed : public QObject NewsFeed(Client *client); virtual ~NewsFeed(); public slots: - Reply *getNews(Filters filters = FilterNone, quint8 count = 25, int offset = 0); + Reply *getNews(Filters filters = FilterNone, quint8 count = 25, int offset = 0); signals: - void newsRecieved(const Vreen::NewsItemList &list); + void newsReceived(const Vreen::NewsItemList &list); private: QScopedPointer d_ptr; diff --git a/src/qml/src/newsfeedmodel.cpp b/src/qml/src/newsfeedmodel.cpp index fb07c30..2017acb 100644 --- a/src/qml/src/newsfeedmodel.cpp +++ b/src/qml/src/newsfeedmodel.cpp @@ -66,7 +66,7 @@ void NewsFeedModel::setClient(QObject *obj) return; auto newsFeed = new Vreen::NewsFeed(client); - connect(newsFeed, SIGNAL(newsRecieved(Vreen::NewsItemList)), SLOT(onNewsRecieved(Vreen::NewsItemList))); + connect(newsFeed, SIGNAL(newsReceived(Vreen::NewsItemList)), SLOT(onNewsReceived(Vreen::NewsItemList))); m_newsFeed = newsFeed; } @@ -194,7 +194,7 @@ static bool newsItemMoreThan(const Vreen::NewsItem &a, const Vreen::NewsItem &b) return a.date() > b.date(); } -void NewsFeedModel::onNewsRecieved(const Vreen::NewsItemList &items) +void NewsFeedModel::onNewsReceived(const Vreen::NewsItemList &items) { foreach (auto item, items) { if (findNews(item.postId()) == -1) { diff --git a/src/qml/src/newsfeedmodel.h b/src/qml/src/newsfeedmodel.h index 65b2b49..31c5c42 100644 --- a/src/qml/src/newsfeedmodel.h +++ b/src/qml/src/newsfeedmodel.h @@ -77,7 +77,7 @@ public slots: void replaceNews(int index, const Vreen::NewsItem &data); inline Vreen::Contact *findContact(int id) const; private slots: - void onNewsRecieved(const Vreen::NewsItemList &data); + void onNewsReceived(const Vreen::NewsItemList &data); void onAddLike(const QVariant &response); void onDeleteLike(const QVariant &response); private: