[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:11:42 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=66ac4b2
The following commit has been merged in the master branch:
commit 66ac4b20c7b1de7b686f1c9026bc91c38443aca2
Author: Peter Amidon <peter at picnicpark.org>
Date: Sun Dec 2 08:05:22 2012 -0800
Removed most references to deprecated ContactModelItem class.
Remove all references to the deprecated ContactModelItem in ContextMenu and ContactOverlays
---
contact-overlays.cpp | 2 +-
contact-overlays.h | 2 --
context-menu.cpp | 55 +++++++++++++++------------------------------
context-menu.h | 1 -
tooltips/tooltipmanager.cpp | 2 +-
5 files changed, 20 insertions(+), 42 deletions(-)
diff --git a/contact-overlays.cpp b/contact-overlays.cpp
index bd601f9..d887c8c 100644
--- a/contact-overlays.cpp
+++ b/contact-overlays.cpp
@@ -124,7 +124,7 @@ void StartChannelContactOverlay::slotClicked(bool checked)
bool StartChannelContactOverlay::checkIndex(const QModelIndex& index) const
{
- return index.data(m_capabilityRole).toBool() && index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>();
+ return index.data(ContactsModel::TypeRole).toInt() == ContactsModel::ContactRowType;
}
// ------------------------------------------------------------------------
diff --git a/contact-overlays.h b/contact-overlays.h
index 6b64d90..855f54e 100644
--- a/contact-overlays.h
+++ b/contact-overlays.h
@@ -29,8 +29,6 @@
#include <TelepathyQt/Types>
-class ContactModelItem;
-
class StartChannelContactOverlay : public ContactDelegateOverlay
{
Q_OBJECT
diff --git a/context-menu.cpp b/context-menu.cpp
index bcb18c9..8c8536f 100644
--- a/context-menu.cpp
+++ b/context-menu.cpp
@@ -82,14 +82,14 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
m_currentIndex = index;
- Tp::ContactPtr contact = index.data(ContactsModel::ItemRole).value<ContactModelItem*>()->contact();
+ Tp::ContactPtr contact = index.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
if (contact.isNull()) {
kDebug() << "Contact is nulled";
return 0;
}
- Tp::AccountPtr account = m_mainWidget->d_ptr->model->accountForContactItem(index.data(ContactsModel::ItemRole).value<ContactModelItem*>());
+ Tp::AccountPtr account = index.data(ContactsModel::AccountRole).value<Tp::AccountPtr>();
if (account.isNull()) {
kDebug() << "Account is nulled";
@@ -313,10 +313,9 @@ KMenu* ContextMenu::groupContextMenu(const QModelIndex &index)
void ContextMenu::onRemoveContactFromGroupTriggered()
{
QString groupName = m_currentIndex.parent().data(GroupsModel::GroupNameRole).toString();
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
Q_ASSERT(contactItem);
- Tp::ContactPtr contact = contactItem->contact();
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
Tp::PendingOperation* operation = contact->removeFromGroup(groupName);
@@ -338,9 +337,9 @@ void ContextMenu::onShowInfoTriggered()
return;
}
- ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
- if (item) {
- QWeakPointer<ContactInfo> contactInfoDialog = new ContactInfo(item->contact(), m_mainWidget);
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
+ if (contact) {
+ QWeakPointer<ContactInfo> contactInfoDialog = new ContactInfo(contact, m_mainWidget);
contactInfoDialog.data()->setAttribute(Qt::WA_DeleteOnClose);
contactInfoDialog.data()->show();
}
@@ -433,10 +432,7 @@ void ContextMenu::onOpenLogViewerTriggered()
void ContextMenu::onUnblockContactTriggered()
{
- ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
- Q_ASSERT(item);
-
- Tp::ContactPtr contact = item->contact();
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
Tp::PendingOperation *operation = contact->unblock(); //FIXME
connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
@@ -445,10 +441,7 @@ void ContextMenu::onUnblockContactTriggered()
void ContextMenu::onAddContactToGroupTriggered()
{
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
-
- Q_ASSERT(contactItem);
- Tp::ContactPtr contact = contactItem->contact();
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
QAction *action = qobject_cast<QAction*>(sender());
if (!action) {
@@ -482,10 +475,7 @@ void ContextMenu::onCreateNewGroupTriggered()
&ok);
if (ok) {
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
-
- Q_ASSERT(contactItem);
- Tp::ContactPtr contact = contactItem->contact();
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
Tp::PendingOperation *operation = contact->addToGroup(newGroupName);
connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
@@ -508,7 +498,7 @@ void ContextMenu::onRenameGroupTriggered()
if (ok) {
for(int i = 0; i < groupItem->size(); i++) {
- Tp::ContactPtr contact = qobject_cast<ProxyTreeNode*>(groupItem->childAt(i))->data(ContactsModel::ItemRole).value<ContactModelItem*>()->contact();
+ Tp::ContactPtr contact = qobject_cast<ProxyTreeNode*>(groupItem->childAt(i))->data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
Q_ASSERT(contact);
Tp::PendingOperation *operation = contact->addToGroup(newGroupName);
@@ -536,7 +526,7 @@ void ContextMenu::onDeleteGroupTriggered()
i18n("Remove Group")) == KMessageBox::Continue) {
for(int i = 0; i < groupItem->size(); i++) {
- Tp::ContactPtr contact = qobject_cast<ProxyTreeNode*>(groupItem->childAt(i))->data(ContactsModel::ItemRole).value<ContactModelItem*>()->contact();
+ Tp::ContactPtr contact = qobject_cast<ProxyTreeNode*>(groupItem->childAt(i))->data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
Q_ASSERT(contact);
@@ -557,10 +547,7 @@ void ContextMenu::onDeleteGroupTriggered()
void ContextMenu::onBlockContactTriggered()
{
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
-
- Q_ASSERT(contactItem);
- Tp::ContactPtr contact = contactItem->contact();
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
Tp::PendingOperation *operation = contact->block();
connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
@@ -569,10 +556,7 @@ void ContextMenu::onBlockContactTriggered()
void ContextMenu::onDeleteContactTriggered()
{
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
-
- Q_ASSERT(contactItem);
- Tp::ContactPtr contact = contactItem->contact();
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
QList<Tp::ContactPtr>contactList;
contactList.append(contact);
@@ -601,26 +585,23 @@ void ContextMenu::onDeleteContactTriggered()
void ContextMenu::onRerequestAuthorization()
{
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
- Tp::PendingOperation *op = contactItem->contact()->manager()->requestPresenceSubscription(QList<Tp::ContactPtr>() << contactItem->contact());
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
+ Tp::PendingOperation *op = contact->manager()->requestPresenceSubscription(QList<Tp::ContactPtr>() << contact);
connect(op, SIGNAL(finished(Tp::PendingOperation*)),
m_mainWidget, SIGNAL(genericOperationFinished(Tp::PendingOperation*)));
}
void ContextMenu::onResendAuthorization()
{
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
- Tp::PendingOperation *op = contactItem->contact()->manager()->authorizePresencePublication(QList<Tp::ContactPtr>() << contactItem->contact());
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
+ Tp::PendingOperation *op = contact->manager()->authorizePresencePublication(QList<Tp::ContactPtr>() << contact);
connect(op, SIGNAL(finished(Tp::PendingOperation*)),
m_mainWidget, SIGNAL(genericOperationFinished(Tp::PendingOperation*)));
}
void ContextMenu::onNotificationConfigureTriggered()
{
- ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
-
- Q_ASSERT(contactItem);
- Tp::ContactPtr contact = contactItem->contact();
+ Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
KTp::NotificationConfigDialog *notificationDialog = new KTp::NotificationConfigDialog(contact, m_mainWidget);
notificationDialog->show();
diff --git a/context-menu.h b/context-menu.h
index 55d20bd..b862550 100644
--- a/context-menu.h
+++ b/context-menu.h
@@ -31,7 +31,6 @@
#include "contact-list-widget.h"
class AccountsModel;
-class ContactModelItem;
class KMenu;
class QAction;
diff --git a/tooltips/tooltipmanager.cpp b/tooltips/tooltipmanager.cpp
index 9ab2cf1..a4aa740 100644
--- a/tooltips/tooltipmanager.cpp
+++ b/tooltips/tooltipmanager.cpp
@@ -144,7 +144,7 @@ void ToolTipManager::showToolTip(const QModelIndex &menuItem)
return;
}
- if (!menuItem.data(ContactsModel::ItemRole).canConvert<ContactModelItem*>()) {
+ if (!menuItem.data(ContactsModel::ContactRole).canConvert<Tp::ContactPtr>()) {
return;
}
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list