From 740343ca5bd92532eb77df67211733db53447a3d Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Tue, 28 Sep 2010 16:08:11 +0000 Subject: add removeContact signaling --- examples/GuiClient/customListView.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'examples/GuiClient/customListView.cpp') diff --git a/examples/GuiClient/customListView.cpp b/examples/GuiClient/customListView.cpp index a071722f..37c6e056 100644 --- a/examples/GuiClient/customListView.cpp +++ b/examples/GuiClient/customListView.cpp @@ -28,7 +28,8 @@ #include #include -customListView::customListView(QWidget* parent):QListView(parent), m_chat("Chat", this), m_profile("View Profile", this) +customListView::customListView(QWidget* parent):QListView(parent), m_chat("Chat", this), +m_profile("View Profile", this), m_removeContact("Remove", this) { bool check = connect(this, SIGNAL(pressed(const QModelIndex&)), this, SLOT(mousePressed(const QModelIndex&))); @@ -46,6 +47,10 @@ customListView::customListView(QWidget* parent):QListView(parent), m_chat("Chat" check = connect(&m_profile, SIGNAL(triggered()), this, SLOT(showProfile_helper())); Q_ASSERT(check); + + check = connect(&m_removeContact, SIGNAL(triggered()), this, + SLOT(removeContact_helper())); + Q_ASSERT(check); } bool customListView::event(QEvent* e) @@ -105,3 +110,10 @@ void customListView::keyPressEvent(QKeyEvent* event1) } QListView::keyPressEvent(event1); } + +void customListView::removeContact_helper() +{ + QString bareJid = selectedBareJid(); + if(!bareJid.isEmpty()) + emit removeContact(bareJid); +} -- cgit v1.2.3