mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-23 00:01:21 -04:00
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:
parent
90aa1e6fc0
commit
a27855450f
10 changed files with 252 additions and 80 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue