Show count of unread NewsFeeds in the Friends Storm tab (without PeerItem's).

Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3773 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-11-10 12:24:36 +00:00
parent 90aa1e6fc0
commit a27855450f
10 changed files with 252 additions and 80 deletions

View file

@ -162,6 +162,8 @@ void NewsFeed::addFeedItem(QWidget *item)
connect(item, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed(QObject*)));
widgetList.push_back(item);
sendNewsFeedChanged();
if (Settings->getAddFeedsAtEnd()) {
verticalLayout->addWidget(item);
} else {
@ -452,6 +454,8 @@ void NewsFeed::itemDestroyed(QObject *item)
if (index >= 0) {
widgetList.removeAt(index);
}
sendNewsFeedChanged();
}
void NewsFeed::removeAll()
@ -468,3 +472,18 @@ void NewsFeed::removeAll()
}
}
}
void NewsFeed::sendNewsFeedChanged()
{
int count = 0;
QObjectList::iterator it;
for (it = widgetList.begin(); it != widgetList.end(); it++) {
if (dynamic_cast<PeerItem*>(*it) == NULL) {
/* don't count PeerItem's */
count++;
}
}
emit newsFeedChanged(count);
}