mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 21:04:32 -04:00
Fix NewFriendList delete by Keyboard
This commit is contained in:
parent
738029f96a
commit
b6b581f4b0
2 changed files with 21 additions and 1 deletions
|
@ -212,7 +212,7 @@ NewFriendList::NewFriendList(QWidget *parent) : /* RsAutoUpdatePage(5000,parent)
|
||||||
// workaround for Qt bug, should be solved in next Qt release 4.7.0
|
// workaround for Qt bug, should be solved in next Qt release 4.7.0
|
||||||
// http://bugreports.qt.nokia.com/browse/QTBUG-8270
|
// http://bugreports.qt.nokia.com/browse/QTBUG-8270
|
||||||
QShortcut *Shortcut = new QShortcut(QKeySequence(Qt::Key_Delete), ui->peerTreeWidget, 0, 0, Qt::WidgetShortcut);
|
QShortcut *Shortcut = new QShortcut(QKeySequence(Qt::Key_Delete), ui->peerTreeWidget, 0, 0, Qt::WidgetShortcut);
|
||||||
connect(Shortcut, SIGNAL(activated()), this, SLOT(removefriend()),Qt::QueuedConnection);
|
connect(Shortcut, SIGNAL(activated()), this, SLOT(removeItem()),Qt::QueuedConnection);
|
||||||
|
|
||||||
QFontMetricsF fontMetrics(ui->peerTreeWidget->font());
|
QFontMetricsF fontMetrics(ui->peerTreeWidget->font());
|
||||||
|
|
||||||
|
@ -915,6 +915,25 @@ void FriendsDialog::viewprofile()
|
||||||
*
|
*
|
||||||
* All of these rely on the finding of the current Id.
|
* All of these rely on the finding of the current Id.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void NewFriendList::removeItem()
|
||||||
|
{
|
||||||
|
QModelIndex index = getCurrentSourceIndex();
|
||||||
|
RsFriendListModel::EntryType type = mModel->getType(index);
|
||||||
|
if(index.isValid())
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
case RsFriendListModel::ENTRY_TYPE_GROUP: removeGroup();
|
||||||
|
break;
|
||||||
|
case RsFriendListModel::ENTRY_TYPE_PROFILE: removeProfile();
|
||||||
|
break;
|
||||||
|
case RsFriendListModel::ENTRY_TYPE_NODE: removeNode();
|
||||||
|
break;
|
||||||
|
case RsFriendListModel::ENTRY_TYPE_UNKNOWN: RsErr()<<__PRETTY_FUNCTION__<<" Get Item of type unknow."<<std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void NewFriendList::removeNode()
|
void NewFriendList::removeNode()
|
||||||
{
|
{
|
||||||
RsFriendListModel::RsNodeDetails det;
|
RsFriendListModel::RsNodeDetails det;
|
||||||
|
|
|
@ -144,6 +144,7 @@ private slots:
|
||||||
void msgGroup();
|
void msgGroup();
|
||||||
void msgProfile();
|
void msgProfile();
|
||||||
void recommendNode();
|
void recommendNode();
|
||||||
|
void removeItem();
|
||||||
void removeNode();
|
void removeNode();
|
||||||
void removeProfile();
|
void removeProfile();
|
||||||
void createNewGroup() ;
|
void createNewGroup() ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue