Disabled refill of FriendSelectionWidget after group changed when no groups are shown.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6444 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-06-20 12:27:51 +00:00
parent c6e2034b66
commit 61d43e8e72
2 changed files with 11 additions and 2 deletions

View File

@ -94,7 +94,7 @@ FriendSelectionWidget::FriendSelectionWidget(QWidget *parent) :
connect(ui->deselectAll_PB, SIGNAL(clicked()), this, SLOT(deselectAll())); connect(ui->deselectAll_PB, SIGNAL(clicked()), this, SLOT(deselectAll()));
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterItems(QString))); connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterItems(QString)));
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(fillList())); connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(groupsChanged(int)));
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&,int)), this, SLOT(peerStatusChanged(const QString&,int))); connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&,int)), this, SLOT(peerStatusChanged(const QString&,int)));
mCompareRole = new RSTreeWidgetItemCompareRole; mCompareRole = new RSTreeWidgetItemCompareRole;
@ -489,6 +489,13 @@ void FriendSelectionWidget::secured_fillList()
emit contentChanged(); emit contentChanged();
} }
void FriendSelectionWidget::groupsChanged(int /*type*/)
{
if (mShowTypes & SHOW_GROUP) {
fillList();
}
}
void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status) void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
{ {
if(!isVisible()) if(!isVisible())
@ -826,6 +833,7 @@ void FriendSelectionWidget::deselectAll()
for(QTreeWidgetItemIterator itemIterator(ui->friendList);*itemIterator!=NULL;++itemIterator) for(QTreeWidgetItemIterator itemIterator(ui->friendList);*itemIterator!=NULL;++itemIterator)
setSelected(mListModus, *itemIterator, false); setSelected(mListModus, *itemIterator, false);
} }
void FriendSelectionWidget::selectAll() void FriendSelectionWidget::selectAll()
{ {
for(QTreeWidgetItemIterator itemIterator(ui->friendList);*itemIterator!=NULL;++itemIterator) for(QTreeWidgetItemIterator itemIterator(ui->friendList);*itemIterator!=NULL;++itemIterator)

View File

@ -105,7 +105,7 @@ signals:
void itemChanged(int idType, const QString &id, QTreeWidgetItem *item, int column); void itemChanged(int idType, const QString &id, QTreeWidgetItem *item, int column);
private slots: private slots:
void fillList(); void groupsChanged(int type);
void peerStatusChanged(const QString& peerId, int status); void peerStatusChanged(const QString& peerId, int status);
void filterItems(const QString &text); void filterItems(const QString &text);
void contextMenuRequested(const QPoint &pos); void contextMenuRequested(const QPoint &pos);
@ -115,6 +115,7 @@ private slots:
void deselectAll() ; void deselectAll() ;
private: private:
void fillList();
void secured_fillList(); void secured_fillList();
bool filterItem(QTreeWidgetItem *item, const QString &text); bool filterItem(QTreeWidgetItem *item, const QString &text);