Fixed crash in context menu of the id list in IdDialog when no row is active.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8410 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-06-11 08:08:10 +00:00
parent 4a6b5dce8f
commit d71d26f026

View File

@ -1012,6 +1012,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
rsIdentity->getOwnIds(own_identities) ; rsIdentity->getOwnIds(own_identities) ;
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem(); QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
if (item) {
uint32_t item_flags = item->data(RSID_COL_KEYID,Qt::UserRole).toUInt() ; uint32_t item_flags = item->data(RSID_COL_KEYID,Qt::UserRole).toUInt() ;
if(!(item_flags & RSID_FILTER_OWNED_BY_YOU)) if(!(item_flags & RSID_FILTER_OWNED_BY_YOU))
@ -1020,7 +1021,6 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
{ {
QAction *action = contextMnu.addAction(QIcon(":/images/chat_24.png"), tr("Chat with this person"), this, SLOT(chatIdentity())); QAction *action = contextMnu.addAction(QIcon(":/images/chat_24.png"), tr("Chat with this person"), this, SLOT(chatIdentity()));
if(own_identities.empty()) if(own_identities.empty())
action->setEnabled(false) ; action->setEnabled(false) ;
else else
@ -1047,6 +1047,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
contextMnu.addAction(QIcon(":/images/mail_new.png"), tr("Send message to this person"), this, SLOT(sendMsg())); contextMnu.addAction(QIcon(":/images/mail_new.png"), tr("Send message to this person"), this, SLOT(sendMsg()));
} }
}
contextMnu.addSeparator(); contextMnu.addSeparator();