Skip to content

Commit

Permalink
Fix typo and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rasendubi committed Jan 31, 2013
1 parent a0e6d0b commit fc826cf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 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
2 changes: 1 addition & 1 deletion 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(onNewsRecieved(Vreen::NewsItemList)));

m_newsFeed = newsFeed;
}
Expand Down

0 comments on commit fc826cf

Please sign in to comment.