[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:32 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=7245c5d

The following commit has been merged in the master branch:
commit 7245c5de9a024e76916284fb0f3037ed52aa2c83
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Wed Sep 12 16:38:56 2012 +0100

    Update with AccountsModel -> ContactModel rename
    
    REVIEW: 107186
---
 abstract-contact-delegate.cpp | 14 +++++-----
 contact-delegate-compact.cpp  |  8 +++---
 contact-delegate.cpp          |  8 +++---
 contact-list-widget.cpp       | 32 +++++++++++------------
 contact-list-widget.h         |  4 +--
 contact-list-widget_p.h       |  4 +--
 contact-overlays.cpp          | 16 ++++++------
 context-menu.cpp              | 60 +++++++++++++++++++++----------------------
 main-widget.cpp               |  4 +--
 tooltips/contacttooltip.cpp   | 10 ++++----
 tooltips/tooltipmanager.cpp   |  4 +--
 11 files changed, 82 insertions(+), 82 deletions(-)

diff --git a/abstract-contact-delegate.cpp b/abstract-contact-delegate.cpp
index bc92109..bf18f23 100644
--- a/abstract-contact-delegate.cpp
+++ b/abstract-contact-delegate.cpp
@@ -32,7 +32,7 @@
 #include <KDE/KIconLoader>
 #include <KDE/KIcon>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/accounts-model-item.h>
 #include <KTp/Models/groups-model.h>
 #include <KTp/Models/contact-model-item.h>
@@ -52,7 +52,7 @@ AbstractContactDelegate::~AbstractContactDelegate()
 
 void AbstractContactDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
 {
-    bool isContact = index.data(AccountsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>();
+    bool isContact = index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>();
 
     if (isContact) {
         paintContact(painter, option, index);
@@ -64,7 +64,7 @@ void AbstractContactDelegate::paint(QPainter* painter, const QStyleOptionViewIte
 QSize AbstractContactDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
 {
     Q_UNUSED(option);
-    bool isContact = index.data(AccountsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>();
+    bool isContact = index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>();
 
     if (isContact) {
         return sizeHintContact(option, index);
@@ -102,11 +102,11 @@ void AbstractContactDelegate::paintHeader(QPainter *painter, const QStyleOptionV
 
     QFont groupFont = KGlobalSettings::smallestReadableFont();
 
-    QString counts = QString(" (%1/%2)").arg(index.data(AccountsModel::OnlineUsersCountRole).toString(),
-                     index.data(AccountsModel::TotalUsersCountRole).toString());
+    QString counts = QString(" (%1/%2)").arg(index.data(ContactsModel::OnlineUsersCountRole).toString(),
+                     index.data(ContactsModel::TotalUsersCountRole).toString());
 
-    if (index.data(AccountsModel::ItemRole).userType() == qMetaTypeId<AccountsModelItem*>()) {
-        painter->drawPixmap(accountGroupRect, KIcon(index.data(AccountsModel::IconRole).toString())
+    if (index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<AccountsModelItem*>()) {
+        painter->drawPixmap(accountGroupRect, KIcon(index.data(ContactsModel::IconRole).toString())
                             .pixmap(32));
     } else {
         painter->drawPixmap(accountGroupRect, KIconLoader::global()->loadIcon(QString("system-users"),
diff --git a/contact-delegate-compact.cpp b/contact-delegate-compact.cpp
index fcaffe6..154478d 100644
--- a/contact-delegate-compact.cpp
+++ b/contact-delegate-compact.cpp
@@ -34,7 +34,7 @@
 #include <KGlobalSettings>
 #include <KDE/KLocale>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/contact-model-item.h>
 #include <KTp/Models/proxy-tree-node.h>
 #include <KTp/Models/groups-model-item.h>
@@ -70,7 +70,7 @@ void ContactDelegateCompact::paintContact(QPainter * painter, const QStyleOption
     iconRect.moveTo(QPoint(iconRect.x() + m_spacing, iconRect.y() + m_spacing));
 
     QPixmap avatar;
-    avatar.load(index.data(AccountsModel::AvatarRole).toString());
+    avatar.load(index.data(ContactsModel::AvatarRole).toString());
 
     bool noContactAvatar = avatar.isNull();
 
@@ -80,7 +80,7 @@ void ContactDelegateCompact::paintContact(QPainter * painter, const QStyleOption
 
     style->drawItemPixmap(painter, iconRect, Qt::AlignCenter, avatar.scaled(iconRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
 
-    KTp::Presence presence = index.data(AccountsModel::PresenceRole).value<KTp::Presence>();
+    KTp::Presence presence = index.data(ContactsModel::PresenceRole).value<KTp::Presence>();
 
     // This value is used to set the correct width for the username and the presence message.
     int rightIconsWidth = m_presenceIconSize + m_spacing;
@@ -96,7 +96,7 @@ void ContactDelegateCompact::paintContact(QPainter * painter, const QStyleOption
     painter->drawPixmap(statusIconRect, icon);
 
     // Right now we only check for 'phone', as that's the most interesting type.
-    if (index.data(AccountsModel::ClientTypesRole).toStringList().contains(QLatin1String("phone"))) {
+    if (index.data(ContactsModel::ClientTypesRole).toStringList().contains(QLatin1String("phone"))) {
         // Additional space is needed for the icons, don't add too much spacing between the two icons
         rightIconsWidth += m_clientTypeIconSize + (m_spacing / 2);
 
diff --git a/contact-delegate.cpp b/contact-delegate.cpp
index 01137f3..27a8e5f 100644
--- a/contact-delegate.cpp
+++ b/contact-delegate.cpp
@@ -34,7 +34,7 @@
 #include <KGlobalSettings>
 #include <KDE/KLocale>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/contact-model-item.h>
 #include <KTp/Models/proxy-tree-node.h>
 #include <KTp/Models/groups-model-item.h>
@@ -73,7 +73,7 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
     iconRect.moveTo(QPoint(iconRect.x() + m_spacing, iconRect.y() + m_spacing));
 
     QPixmap avatar;
-    avatar.load(index.data(AccountsModel::AvatarRole).toString());
+    avatar.load(index.data(ContactsModel::AvatarRole).toString());
 
     bool noContactAvatar = avatar.isNull();
 
@@ -96,7 +96,7 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
         painter->drawPath(roundedPath);
     }
 
-    KTp::Presence presence = index.data(AccountsModel::PresenceRole).value<KTp::Presence>();
+    KTp::Presence presence = index.data(ContactsModel::PresenceRole).value<KTp::Presence>();
 
     // This value is used to set the correct width for the username and the presence message.
     int rightIconsWidth = m_presenceIconSize + m_spacing;
@@ -111,7 +111,7 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
     painter->drawPixmap(statusIconRect, icon);
 
     // Right now we only check for 'phone', as that's the most interesting type.
-    if (index.data(AccountsModel::ClientTypesRole).toStringList().contains(QLatin1String("phone"))) {
+    if (index.data(ContactsModel::ClientTypesRole).toStringList().contains(QLatin1String("phone"))) {
         // Additional space is needed for the icons, don't add too much spacing between the two icons
         rightIconsWidth += m_presenceIconSize + m_spacing / 2;
 
diff --git a/contact-list-widget.cpp b/contact-list-widget.cpp
index 6414dab..159ae1d 100644
--- a/contact-list-widget.cpp
+++ b/contact-list-widget.cpp
@@ -25,7 +25,7 @@
 #include <TelepathyQt/PendingChannelRequest>
 #include <TelepathyQt/PendingReady>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/groups-model.h>
 #include <KTp/Models/accounts-filter-model.h>
 #include <KTp/Models/contact-model-item.h>
@@ -73,7 +73,7 @@ ContactListWidget::ContactListWidget(QWidget *parent)
     d->delegate = new ContactDelegate(this);
     d->compactDelegate = new ContactDelegateCompact(ContactDelegateCompact::Normal, this);
 
-    d->model = new AccountsModel(this);
+    d->model = new ContactsModel(this);
     d->groupsModel = new GroupsModel(d->model, this);
     d->modelFilter = new AccountsFilterModel(this);
     d->modelFilter->setDynamicSortFilter(true);
@@ -149,7 +149,7 @@ void ContactListWidget::setAccountManager(const Tp::AccountManagerPtr &accountMa
     }
 }
 
-AccountsModel* ContactListWidget::accountsModel()
+ContactsModel* ContactListWidget::accountsModel()
 {
     Q_D(ContactListWidget);
 
@@ -183,13 +183,13 @@ void ContactListWidget::onContactListClicked(const QModelIndex& index)
         return;
     }
 
-    if (index.data(AccountsModel::ItemRole).userType() == qMetaTypeId<AccountsModelItem*>()
-        || index.data(AccountsModel::ItemRole).userType() == qMetaTypeId<GroupsModelItem*>()) {
+    if (index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<AccountsModelItem*>()
+        || index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<GroupsModelItem*>()) {
 
         KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
         KConfigGroup groupsConfig = config->group("GroupsState");
 
-        QString groupId = index.data(AccountsModel::IdRole).toString();
+        QString groupId = index.data(ContactsModel::IdRole).toString();
 
         if (isExpanded(index)) {
             collapse(index);
@@ -212,9 +212,9 @@ void ContactListWidget::onContactListDoubleClicked(const QModelIndex& index)
         return;
     }
 
-    if (index.data(AccountsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>()) {
+    if (index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>()) {
         kDebug() << "Text chat requested for index" << index;
-        startTextChannel(index.data(AccountsModel::ItemRole).value<ContactModelItem*>());
+        startTextChannel(index.data(ContactsModel::ItemRole).value<ContactModelItem*>());
     }
 }
 
@@ -450,7 +450,7 @@ void ContactListWidget::onNewGroupModelItemsInserted(const QModelIndex& index, i
         //we're probably dealing with group item, so let's check if it is expanded first
         if (!isExpanded(index)) {
             //if it's not expanded, check the config if we should expand it or not
-            QString groupId = index.data(AccountsModel::IdRole).toString();
+            QString groupId = index.data(ContactsModel::IdRole).toString();
             if (d->groupStates.value(groupId)) {
                 expand(index);
             }
@@ -580,7 +580,7 @@ void ContactListWidget::mousePressEvent(QMouseEvent *event)
     d->shouldDrag = false;
 
     // if no contact, no drag
-    if (!index.data(AccountsModel::ItemRole).canConvert<ContactModelItem*>()) {
+    if (!index.data(ContactsModel::ItemRole).canConvert<ContactModelItem*>()) {
         return;
     }
 
@@ -615,7 +615,7 @@ void ContactListWidget::mouseMoveEvent(QMouseEvent *event)
     QDataStream stream(&encodedData, QIODevice::WriteOnly);
 
     if (index.isValid()) {
-        ContactModelItem *contactItem = index.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+        ContactModelItem *contactItem = index.data(ContactsModel::ItemRole).value<ContactModelItem*>();
         //We put a contact ID and its account ID to the stream, so we can later recreate the contact using AccountsModel
         stream << contactItem->contact().data()->id() << d->model->accountForContactItem(contactItem).data()->objectPath();
     }
@@ -639,7 +639,7 @@ void ContactListWidget::dropEvent(QDropEvent *event)
     if (event->mimeData()->hasUrls()) {
         kDebug() << "It's a file!";
 
-        ContactModelItem* contactItem = index.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+        ContactModelItem* contactItem = index.data(ContactsModel::ItemRole).value<ContactModelItem*>();
         Q_ASSERT(contactItem);
 
         Tp::ContactPtr contact = contactItem->contact();
@@ -684,7 +684,7 @@ void ContactListWidget::dropEvent(QDropEvent *event)
         Q_FOREACH (ContactModelItem *contact, contacts) {
             Q_ASSERT(contact);
             QString group;
-            if (index.data(AccountsModel::ItemRole).canConvert<GroupsModelItem*>()) {
+            if (index.data(ContactsModel::ItemRole).canConvert<GroupsModelItem*>()) {
                 // contact is dropped on a group, so take it's name
                 group = index.data(GroupsModel::GroupNameRole).toString();
             } else {
@@ -741,13 +741,13 @@ void ContactListWidget::dragMoveEvent(QDragMoveEvent *event)
 
     // urls can be dropped on a contact with file transfer capability,
     // contacts can be dropped either on a group or on another contact if GroupsModel is used
-    if (event->mimeData()->hasUrls() && index.data(AccountsModel::FileTransferCapabilityRole).toBool()) {
+    if (event->mimeData()->hasUrls() && index.data(ContactsModel::FileTransferCapabilityRole).toBool()) {
         event->acceptProposedAction();
         setDropIndicatorRect(visualRect(index));
     } else if (event->mimeData()->hasFormat("application/vnd.telepathy.contact") &&
                d->modelFilter->sourceModel() == d->groupsModel &&
-               (index.data(AccountsModel::ItemRole).canConvert<GroupsModelItem*>() ||
-                index.data(AccountsModel::ItemRole).canConvert<ContactModelItem*>())) {
+               (index.data(ContactsModel::ItemRole).canConvert<GroupsModelItem*>() ||
+                index.data(ContactsModel::ItemRole).canConvert<ContactModelItem*>())) {
         event->acceptProposedAction();
         setDropIndicatorRect(visualRect(index));
     } else {
diff --git a/contact-list-widget.h b/contact-list-widget.h
index b3b4f7c..3ed83b3 100644
--- a/contact-list-widget.h
+++ b/contact-list-widget.h
@@ -24,7 +24,7 @@
 #include <TelepathyQt/Types>
 #include <TelepathyQt/Connection>
 
-class AccountsModel;
+class ContactsModel;
 class ContactModelItem;
 class ContactListWidgetPrivate;
 
@@ -42,7 +42,7 @@ public:
     explicit ContactListWidget(QWidget* parent);
     virtual ~ContactListWidget();
 
-    AccountsModel *accountsModel();
+    ContactsModel *accountsModel();
     void setAccountManager(const Tp::AccountManagerPtr &accountManager);
 
 public Q_SLOTS:
diff --git a/contact-list-widget_p.h b/contact-list-widget_p.h
index 5868c88..131a20a 100644
--- a/contact-list-widget_p.h
+++ b/contact-list-widget_p.h
@@ -22,7 +22,7 @@
 
 #include <TelepathyQt/Types>
 
-class AccountsModel;
+class ContactsModel;
 class GroupsModel;
 class AccountsFilterModel;
 class ContactDelegate;
@@ -39,7 +39,7 @@ public:
       shouldDrag(false),
       showOffline(false) {}
 
-    AccountsModel          *model;
+    ContactsModel          *model;
     GroupsModel            *groupsModel;
     AccountsFilterModel    *modelFilter;
     ContactDelegate        *delegate;
diff --git a/contact-overlays.cpp b/contact-overlays.cpp
index 9ff4ae2..0c1bcbe 100644
--- a/contact-overlays.cpp
+++ b/contact-overlays.cpp
@@ -25,7 +25,7 @@
 #include <KIconLoader>
 #include <KDebug>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/contact-model-item.h>
 
 const int spacing = IconSize(KIconLoader::Dialog) / 8;
@@ -114,7 +114,7 @@ void StartChannelContactOverlay::slotClicked(bool checked)
     QModelIndex index = button()->index();
 
     if (index.isValid()) {
-        ContactModelItem* contactItem = index.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+        ContactModelItem* contactItem = index.data(ContactsModel::ItemRole).value<ContactModelItem*>();
         if (contactItem) {
             emit activated(contactItem);
         }
@@ -123,7 +123,7 @@ void StartChannelContactOverlay::slotClicked(bool checked)
 
 bool StartChannelContactOverlay::checkIndex(const QModelIndex& index) const
 {
-    return index.data(m_capabilityRole).toBool() && index.data(AccountsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>();
+    return index.data(m_capabilityRole).toBool() && index.data(ContactsModel::ItemRole).userType() == qMetaTypeId<ContactModelItem*>();
 }
 
 // ------------------------------------------------------------------------
@@ -133,7 +133,7 @@ TextChannelContactOverlay::TextChannelContactOverlay(QObject *parent)
         parent,
         KGuiItem(i18n("Start Chat"), "text-x-generic",
                  i18n("Start Chat"), i18n("Start a text chat")),
-        AccountsModel::TextChatCapabilityRole,
+        ContactsModel::TextChatCapabilityRole,
         IconSize(KIconLoader::Dialog) + spacing * 2)
 {
 }
@@ -145,7 +145,7 @@ AudioChannelContactOverlay::AudioChannelContactOverlay(QObject *parent)
         parent,
         KGuiItem(i18n("Start Audio Call"), "audio-headset",
                  i18n("Start Audio Call"), i18n("Start an audio call")),
-        AccountsModel::AudioCallCapabilityRole,
+        ContactsModel::AudioCallCapabilityRole,
         IconSize(KIconLoader::Dialog) + spacing * 3 + IconSize(KIconLoader::Small))
 
 {
@@ -158,7 +158,7 @@ VideoChannelContactOverlay::VideoChannelContactOverlay(QObject *parent)
         parent,
         KGuiItem(i18n("Start Video Call"), "camera-web",
                  i18n("Start Video Call"), i18n("Start a video call")),
-        AccountsModel::VideoCallCapabilityRole,
+        ContactsModel::VideoCallCapabilityRole,
         IconSize(KIconLoader::Dialog) + spacing * 4 + IconSize(KIconLoader::Small) * 2)
 {
 }
@@ -170,7 +170,7 @@ FileTransferContactOverlay::FileTransferContactOverlay(QObject *parent)
         parent,
         KGuiItem(i18n("Send File..."), "mail-attachment",
                  i18n("Send File..."), i18n("Send a file")),
-        AccountsModel::FileTransferCapabilityRole,
+        ContactsModel::FileTransferCapabilityRole,
         IconSize(KIconLoader::Dialog) + spacing * 5 + IconSize(KIconLoader::Small) * 3)
 {
 }
@@ -182,7 +182,7 @@ DesktopSharingContactOverlay::DesktopSharingContactOverlay(QObject *parent)
         parent,
         KGuiItem(i18n("Share my desktop"), "krfb",
                  i18n("Share my desktop"), i18n("Share desktop using RFB")),
-        AccountsModel::DesktopSharingCapabilityRole,
+        ContactsModel::DesktopSharingCapabilityRole,
         IconSize(KIconLoader::Dialog) + spacing * 6 + IconSize(KIconLoader::Small) * 4)
 {
 }
diff --git a/context-menu.cpp b/context-menu.cpp
index fa19283..85968ce 100644
--- a/context-menu.cpp
+++ b/context-menu.cpp
@@ -28,7 +28,7 @@
 #include <KInputDialog>
 #include <KMessageBox>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/contact-model-item.h>
 #include <KTp/Models/proxy-tree-node.h>
 #include <KTp/Models/groups-model-item.h>
@@ -81,14 +81,14 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
 
     m_currentIndex = index;
 
-    Tp::ContactPtr contact = index.data(AccountsModel::ItemRole).value<ContactModelItem*>()->contact();
+    Tp::ContactPtr contact = index.data(ContactsModel::ItemRole).value<ContactModelItem*>()->contact();
 
     if (contact.isNull()) {
         kDebug() << "Contact is nulled";
         return 0;
     }
 
-    Tp::AccountPtr account = m_mainWidget->d_ptr->model->accountForContactItem(index.data(AccountsModel::ItemRole).value<ContactModelItem*>());
+    Tp::AccountPtr account = m_mainWidget->d_ptr->model->accountForContactItem(index.data(ContactsModel::ItemRole).value<ContactModelItem*>());
 
     if (account.isNull()) {
         kDebug() << "Account is nulled";
@@ -105,7 +105,7 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     connect(action, SIGNAL(triggered(bool)),
             SLOT(onStartTextChatTriggered()));
 
-    if (index.data(AccountsModel::TextChatCapabilityRole).toBool()) {
+    if (index.data(ContactsModel::TextChatCapabilityRole).toBool()) {
         action->setEnabled(true);
     }
 
@@ -121,7 +121,7 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     connect(action, SIGNAL(triggered(bool)),
             SLOT(onStartAudioChatTriggered()));
 
-    if (index.data(AccountsModel::AudioCallCapabilityRole).toBool()) {
+    if (index.data(ContactsModel::AudioCallCapabilityRole).toBool()) {
         action->setEnabled(true);
     }
 
@@ -131,7 +131,7 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     connect(action, SIGNAL(triggered(bool)),
             SLOT(onStartVideoChatTriggered()));
 
-    if (index.data(AccountsModel::VideoCallCapabilityRole).toBool()) {
+    if (index.data(ContactsModel::VideoCallCapabilityRole).toBool()) {
         action->setEnabled(true);
     }
 
@@ -141,7 +141,7 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     connect(action, SIGNAL(triggered(bool)),
             SLOT(onStartFileTransferTriggered()));
 
-    if (index.data(AccountsModel::FileTransferCapabilityRole).toBool()) {
+    if (index.data(ContactsModel::FileTransferCapabilityRole).toBool()) {
         action->setEnabled(true);
     }
 
@@ -151,7 +151,7 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     connect(action, SIGNAL(triggered(bool)),
             SLOT(onStartDesktopSharingTriggered()));
 
-    if (index.data(AccountsModel::DesktopSharingCapabilityRole).toBool()) {
+    if (index.data(ContactsModel::DesktopSharingCapabilityRole).toBool()) {
         action->setEnabled(true);
     }
 
@@ -175,7 +175,7 @@ KMenu* ContextMenu::contactContextMenu(const QModelIndex &index)
     // add "goto" submenu for navigating to links the contact has in presence message
     // first check to see if there are any links in the contact's presence message
     QStringList contactLinks;
-    QString presenceMsg = index.data(AccountsModel::PresenceMessageRole).toString();
+    QString presenceMsg = index.data(ContactsModel::PresenceMessageRole).toString();
     if (presenceMsg.isEmpty()) {
         contactLinks = QStringList();
     } else {
@@ -286,7 +286,7 @@ KMenu* ContextMenu::groupContextMenu(const QModelIndex &index)
 
     m_currentIndex = index;
 
-    GroupsModelItem *groupItem = index.data(AccountsModel::ItemRole).value<GroupsModelItem*>();
+    GroupsModelItem *groupItem = index.data(ContactsModel::ItemRole).value<GroupsModelItem*>();
 
     Q_ASSERT(groupItem);
 
@@ -312,7 +312,7 @@ KMenu* ContextMenu::groupContextMenu(const QModelIndex &index)
 void ContextMenu::onRemoveContactFromGroupTriggered()
 {
     QString groupName = m_currentIndex.parent().data(GroupsModel::GroupNameRole).toString();
-    ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
 
     Q_ASSERT(contactItem);
     Tp::ContactPtr contact =  contactItem->contact();
@@ -337,7 +337,7 @@ void ContextMenu::onShowInfoTriggered()
         return;
     }
 
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     if (item) {
         QWeakPointer<ContactInfo> contactInfoDialog = new ContactInfo(item->contact(), m_mainWidget);
         contactInfoDialog.data()->setAttribute(Qt::WA_DeleteOnClose);
@@ -352,7 +352,7 @@ void ContextMenu::onStartTextChatTriggered()
         return;
     }
 
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     if (item) {
         m_mainWidget->startTextChannel(item);
     }
@@ -365,7 +365,7 @@ void ContextMenu::onStartAudioChatTriggered()
         return;
     }
 
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     if (item) {
         m_mainWidget->startAudioChannel(item);
     }
@@ -378,7 +378,7 @@ void ContextMenu::onStartVideoChatTriggered()
         return;
     }
 
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     if (item) {
         m_mainWidget->startVideoChannel(item);
     }
@@ -391,7 +391,7 @@ void ContextMenu::onStartFileTransferTriggered()
         return;
     }
 
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     if (item) {
         m_mainWidget->startFileTransferChannel(item);
     }
@@ -404,7 +404,7 @@ void ContextMenu::onStartDesktopSharingTriggered()
         return;
     }
 
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     if (item) {
         m_mainWidget->startDesktopSharing(item);
     }
@@ -417,7 +417,7 @@ void ContextMenu::onOpenLogViewerTriggered()
       return;
     }
 
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     Q_ASSERT(item);
 
     Tp::ContactPtr contact = item->contact();
@@ -430,7 +430,7 @@ void ContextMenu::onOpenLogViewerTriggered()
 
 void ContextMenu::onUnblockContactTriggered()
 {
-    ContactModelItem *item = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *item = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     Q_ASSERT(item);
 
     Tp::ContactPtr contact = item->contact();
@@ -442,7 +442,7 @@ void ContextMenu::onUnblockContactTriggered()
 
 void ContextMenu::onAddContactToGroupTriggered()
 {
-    ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
 
     Q_ASSERT(contactItem);
     Tp::ContactPtr contact =  contactItem->contact();
@@ -479,7 +479,7 @@ void ContextMenu::onCreateNewGroupTriggered()
                                                  &ok);
 
     if (ok) {
-        ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+        ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
 
         Q_ASSERT(contactItem);
         Tp::ContactPtr contact =  contactItem->contact();
@@ -492,7 +492,7 @@ void ContextMenu::onCreateNewGroupTriggered()
 
 void ContextMenu::onRenameGroupTriggered()
 {
-    GroupsModelItem *groupItem = m_currentIndex.data(AccountsModel::ItemRole).value<GroupsModelItem*>();
+    GroupsModelItem *groupItem = m_currentIndex.data(ContactsModel::ItemRole).value<GroupsModelItem*>();
 
     Q_ASSERT(groupItem);
 
@@ -505,7 +505,7 @@ void ContextMenu::onRenameGroupTriggered()
 
     if (ok) {
         for(int i = 0; i < groupItem->size(); i++) {
-            Tp::ContactPtr contact = qobject_cast<ProxyTreeNode*>(groupItem->childAt(i))->data(AccountsModel::ItemRole).value<ContactModelItem*>()->contact();
+            Tp::ContactPtr contact = qobject_cast<ProxyTreeNode*>(groupItem->childAt(i))->data(ContactsModel::ItemRole).value<ContactModelItem*>()->contact();
             Q_ASSERT(contact);
 
             Tp::PendingOperation *operation = contact->addToGroup(newGroupName);
@@ -525,7 +525,7 @@ void ContextMenu::onDeleteGroupTriggered()
         return;
     }
 
-    GroupsModelItem *groupItem = m_currentIndex.data(AccountsModel::ItemRole).value<GroupsModelItem*>();
+    GroupsModelItem *groupItem = m_currentIndex.data(ContactsModel::ItemRole).value<GroupsModelItem*>();
 
     if (KMessageBox::warningContinueCancel(m_mainWidget,
                                            i18n("Do you really want to remove group %1?

"
@@ -533,7 +533,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(AccountsModel::ItemRole).value<ContactModelItem*>()->contact();
+            Tp::ContactPtr contact = qobject_cast<ProxyTreeNode*>(groupItem->childAt(i))->data(ContactsModel::ItemRole).value<ContactModelItem*>()->contact();
 
             Q_ASSERT(contact);
 
@@ -554,7 +554,7 @@ void ContextMenu::onDeleteGroupTriggered()
 
 void ContextMenu::onBlockContactTriggered()
 {
-    ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
 
     Q_ASSERT(contactItem);
     Tp::ContactPtr contact =  contactItem->contact();
@@ -566,7 +566,7 @@ void ContextMenu::onBlockContactTriggered()
 
 void ContextMenu::onDeleteContactTriggered()
 {
-    ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
 
     Q_ASSERT(contactItem);
     Tp::ContactPtr contact =  contactItem->contact();
@@ -598,7 +598,7 @@ void ContextMenu::onDeleteContactTriggered()
 
 void ContextMenu::onRerequestAuthorization()
 {
-    ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     Tp::PendingOperation *op = contactItem->contact()->manager()->requestPresenceSubscription(QList<Tp::ContactPtr>() << contactItem->contact());
     connect(op, SIGNAL(finished(Tp::PendingOperation*)),
             m_mainWidget, SIGNAL(genericOperationFinished(Tp::PendingOperation*)));
@@ -606,7 +606,7 @@ void ContextMenu::onRerequestAuthorization()
 
 void ContextMenu::onResendAuthorization()
 {
-    ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
     Tp::PendingOperation *op = contactItem->contact()->manager()->authorizePresencePublication(QList<Tp::ContactPtr>() << contactItem->contact());
     connect(op, SIGNAL(finished(Tp::PendingOperation*)),
             m_mainWidget, SIGNAL(genericOperationFinished(Tp::PendingOperation*)));
@@ -614,7 +614,7 @@ void ContextMenu::onResendAuthorization()
 
 void ContextMenu::onNotificationConfigureTriggered()
 {
-    ContactModelItem *contactItem = m_currentIndex.data(AccountsModel::ItemRole).value<ContactModelItem*>();
+    ContactModelItem *contactItem = m_currentIndex.data(ContactsModel::ItemRole).value<ContactModelItem*>();
 
     Q_ASSERT(contactItem);
     Tp::ContactPtr contact = contactItem->contact();
diff --git a/main-widget.cpp b/main-widget.cpp
index dec8318..174eb55 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -36,7 +36,7 @@
 #include <TelepathyQt/ContactManager>
 #include <TelepathyQt/PendingReady>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/contact-model-item.h>
 #include <KTp/Models/groups-model-item.h>
 #include <KTp/Widgets/add-contact-dialog.h>
@@ -368,7 +368,7 @@ void MainWidget::onCustomContextMenuRequested(const QPoint &pos)
     }
 
     Tp::ContactPtr contact;
-    QVariant item = index.data(AccountsModel::ItemRole);
+    QVariant item = index.data(ContactsModel::ItemRole);
 
     KMenu *menu = 0;
 
diff --git a/tooltips/contacttooltip.cpp b/tooltips/contacttooltip.cpp
index 738bd5d..8b4d820 100644
--- a/tooltips/contacttooltip.cpp
+++ b/tooltips/contacttooltip.cpp
@@ -24,7 +24,7 @@
 #include "ui_contacttooltip.h"
 #include "ktooltip.h"
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/text-parser.h>
 #include <KTp/presence.h>
 
@@ -40,11 +40,11 @@ ContactToolTip::ContactToolTip(const QModelIndex &index) :
 {
     ui->setupUi(this);
     ui->nameLabel->setText(index.data(Qt::DisplayRole).toString());
-    ui->idLabel->setText(index.data(AccountsModel::IdRole).toString());
+    ui->idLabel->setText(index.data(ContactsModel::IdRole).toString());
     ui->avatarLabel->setScaledContents(false);
     ui->avatarLabel->setAlignment(Qt::AlignCenter);
 
-    QString avatar = index.data(AccountsModel::AvatarRole).toString();
+    QString avatar = index.data(ContactsModel::AvatarRole).toString();
     if (avatar.isEmpty()) {
         ui->avatarLabel->setPixmap(KIconLoader::global()->loadIcon("im-user", KIconLoader::NoGroup, 96));
     } else {
@@ -52,7 +52,7 @@ ContactToolTip::ContactToolTip(const QModelIndex &index) :
         ui->avatarLabel->setPixmap(avatarPixmap.scaled(ui->avatarLabel->size(), Qt::KeepAspectRatio));
     }
 
-    KTp::Presence presence = index.data(AccountsModel::PresenceRole).value<KTp::Presence>();
+    KTp::Presence presence = index.data(ContactsModel::PresenceRole).value<KTp::Presence>();
 
     QString presenceMessage;
     QString presenceIconPath = KIconLoader::global()->iconPath("task-attention", 1);
@@ -78,7 +78,7 @@ ContactToolTip::ContactToolTip(const QModelIndex &index) :
     ui->presenceIcon->setPixmap(QPixmap(presenceIconPath));
     ui->presenceLabel->setText(presenceText);
     ui->presenceMessageLabel->setText(presenceMessage);
-    ui->blockedLabel->setShown(index.data(AccountsModel::BlockedRole).toBool());
+    ui->blockedLabel->setShown(index.data(ContactsModel::BlockedRole).toBool());
 
     connect(ui->presenceMessageLabel, SIGNAL(linkActivated(QString)), this, SLOT(openLink(QString)));
 }
diff --git a/tooltips/tooltipmanager.cpp b/tooltips/tooltipmanager.cpp
index 7c506d7..9ab2cf1 100644
--- a/tooltips/tooltipmanager.cpp
+++ b/tooltips/tooltipmanager.cpp
@@ -37,7 +37,7 @@
 #include <KIcon>
 #include <KColorScheme>
 
-#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/contacts-model.h>
 #include <KTp/Models/contact-model-item.h>
 
 
@@ -144,7 +144,7 @@ void ToolTipManager::showToolTip(const  QModelIndex &menuItem)
         return;
     }
 
-    if (!menuItem.data(AccountsModel::ItemRole).canConvert<ContactModelItem*>()) {
+    if (!menuItem.data(ContactsModel::ItemRole).canConvert<ContactModelItem*>()) {
         return;
     }
 

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list