mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
limit max number of feed items to 500, to avoid flooding possibility. Improved text
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7023 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8594d68985
commit
b8c65db00e
@ -452,10 +452,22 @@ void NewsFeed::testFeed(FeedNotify *feedNotify)
|
||||
|
||||
void NewsFeed::addFeedItem(QWidget *item)
|
||||
{
|
||||
static const unsigned int MAX_WIDGETS_SIZE = 500 ;
|
||||
|
||||
item->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
connect(item, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed(QObject*)));
|
||||
widgets.insert(item);
|
||||
widgets.push_back(item);
|
||||
|
||||
// costly, but not really a problem here
|
||||
while(widgets.size() > MAX_WIDGETS_SIZE)
|
||||
{
|
||||
QWidget *item = dynamic_cast<QWidget*>(widgets.front()) ;
|
||||
|
||||
if(item)
|
||||
item->close() ;
|
||||
widgets.pop_front() ;
|
||||
}
|
||||
|
||||
sendNewsFeedChanged();
|
||||
|
||||
|
@ -94,7 +94,7 @@ private:
|
||||
|
||||
void sendNewsFeedChanged();
|
||||
|
||||
QSet<QObject*> widgets;
|
||||
std::list<QObject*> widgets;
|
||||
|
||||
/* lists of feedItems */
|
||||
std::list<ForumNewItem *> mForumNewItems;
|
||||
|
@ -127,14 +127,14 @@ void SecurityItem::updateItemStatic()
|
||||
requestLabel->hide();
|
||||
break;
|
||||
case RS_FEED_ITEM_SEC_WRONG_SIGNATURE:
|
||||
title = tr("Certificate has wrong signature!! Peer is not who he claims to be.");
|
||||
title = tr("Certificate has wrong signature!! This peer is not who he claims to be.");
|
||||
requestLabel->hide();
|
||||
break;
|
||||
case RS_FEED_ITEM_SEC_BAD_CERTIFICATE:
|
||||
{
|
||||
RsPeerDetails details ;
|
||||
if(rsPeers->getPeerDetails(mGpgId, details))
|
||||
title = tr("Missing/Damaged certificate. Someone is probably trying to impersonate key ") + QString::fromStdString(mGpgId);
|
||||
title = tr("Missing/Damaged SSL certificate for key ") + QString::fromStdString(mGpgId) ;
|
||||
else
|
||||
title = tr("Missing/Damaged certificate. Not a real Retroshare user.");
|
||||
requestLabel->hide();
|
||||
|
Loading…
Reference in New Issue
Block a user