Skip to content

Commit

Permalink
Merge pull request #17 from rasendubi/fix0
Browse files Browse the repository at this point in the history
Fix typo and indentation
  • Loading branch information
alekseysidorov committed Feb 3, 2013
2 parents 72dc426 + ac8eeac commit d8ce820
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
42 changes: 21 additions & 21 deletions src/api/newsfeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

/*!
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/newsfeed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<NewsFeedPrivate> d_ptr;

Expand Down
4 changes: 2 additions & 2 deletions src/qml/src/newsfeedmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/qml/src/newsfeedmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d8ce820

Please sign in to comment.