[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:14:17 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=6900c94
The following commit has been merged in the master branch:
commit 6900c9455283726482f09cb51159cbf09ff9a21f
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Sun Nov 24 15:26:51 2013 +0100
Restore merge/unmerge functionality with kpeople2
---
contact-list-widget.cpp | 8 +++---
main-widget.cpp | 67 +++++--------------------------------------------
2 files changed, 10 insertions(+), 65 deletions(-)
diff --git a/contact-list-widget.cpp b/contact-list-widget.cpp
index ad4d5ce..3479131 100644
--- a/contact-list-widget.cpp
+++ b/contact-list-widget.cpp
@@ -739,9 +739,9 @@ void ContactListWidget::mouseMoveEvent(QMouseEvent *event)
mimeData->setData("application/vnd.telepathy.contact", encodedData);
- kDebug() << index.data(KTp::NepomukUriRole).toString().toLatin1();
+ kDebug() << index.data(KTp::PersonIdRole).toString().toLatin1();
- mimeData->setData("application/vnd.kpeople.uri", index.data(KTp::NepomukUriRole).toString().toLatin1());
+ mimeData->setData("application/vnd.kpeople.uri", index.data(KTp::PersonIdRole).toString().toLatin1());
QPixmap dragIndicator = QPixmap::grabWidget(this, visualRect(index).adjusted(3,3,3,3));
@@ -789,14 +789,14 @@ void ContactListWidget::dropEvent(QDropEvent *event)
} else if ((index.data(KTp::RowTypeRole).toInt() == KTp::ContactRowType || index.data(KTp::RowTypeRole).toInt() == KTp::PersonRowType) &&
event->mimeData()->hasFormat("application/vnd.kpeople.uri") && KTp::kpeopleEnabled()) {
#ifdef HAVE_KPEOPLE
- QString droppedUri(index.data(KTp::NepomukUriRole).toString());
+ QString droppedUri(index.data(KTp::PersonIdRole).toString());
QString draggedUri(event->mimeData()->data("application/vnd.kpeople.uri"));
if(droppedUri != draggedUri) {
KMenu menu;
QAction *mergeAction = menu.addAction(i18n("Merge contacts"));
QAction *result = menu.exec(mapToGlobal(event->pos()));
if (result == mergeAction) {
-// KPeople::mergeContacts(QStringList << droppedUri << draggedUri);
+ KPeople::mergeContacts(QStringList() << droppedUri << draggedUri);
}
event->acceptProposedAction();
}
diff --git a/main-widget.cpp b/main-widget.cpp
index c6d6178..74d55e9 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -738,73 +738,18 @@ void MainWidget::onMetacontactToggleTriggered()
break;
}
- uris << index.data(KTp::NepomukUriRole).toString();
+ uris << index.data(KTp::PersonIdRole).toString();
}
if (!invalid) {
-// KPeople::mergeContacts(uris);
+ KPeople::mergeContacts(uris);
}
} else {
//we're removing contacts from person
- QList<QUrl> contacts;
- QUrl personUri;
-
- if (selection.size() == 1) {
- QModelIndex index = selection.first();
- if (index.data(KTp::RowTypeRole).toInt() == KTp::PersonRowType) {
- //the user selected person, which means removing the person
- personUri = index.data(KTp::NepomukUriRole).toUrl();
- for (int i = 0; i < m_contactsListView->model()->rowCount(index); i++) {
- contacts << index.child(i, 0).data(KTp::NepomukUriRole).toUrl();
- }
- } else {
- //user selected one of person's contacts
- if (index.parent().isValid() && index.parent().data(KTp::RowTypeRole).toInt() == KTp::PersonRowType) {
- personUri = index.parent().data(KTp::NepomukUriRole).toUrl();
- contacts.append(index.data(KTp::NepomukUriRole).toUrl());
- } else {
- return;
- }
- }
-
-// KPeople::PersonsModel::unlinkContactFromPerson(personUri, contacts);
-
- } else if (selection.size() > 1) {
- QModelIndex person;
- bool invalid = false;
- QList<QUrl> contactUris;
- Q_FOREACH (const QModelIndex &index, selection) {
- if (!person.isValid()) {
- if (index.data(KTp::RowTypeRole).toInt() == KTp::PersonRowType) {
- //if the current index is person
- person = index;
-
- } else if (index.parent().isValid() && index.parent().data(KTp::RowTypeRole).toInt() == KTp::PersonRowType) {
- //if the current index is contact that has valid person as parent
- person = index.parent();
- }
- } else {
- if (index.data(KTp::RowTypeRole).toInt() == KTp::PersonRowType
- || (index.parent().isValid() && index.parent() != person)) {
- //we can have max 1 person in the selection
- //second one means break; also contact from different person
- //than the one we already have means break
- kDebug() << "Found second person in selection, aborting";
- invalid = true;
- break;
- }
- }
-
- if (index.data(KTp::RowTypeRole).toInt() == KTp::ContactRowType) {
- contactUris << index.data(KTp::NepomukUriRole).toUrl();
- }
- }
-
- if (!invalid) {
- //FXIME
-// KPeople::PersonsModel::unlinkContactFromPerson(person.data(KTp::NepomukUriRole).toUrl(), contactUris);
- }
- }
+ QStringList contacts;
+ const QModelIndex &index = selection.first();
+ const QString &personUri = index.data(KTp::PersonIdRole).toString();
+ KPeople::unmergeContact(personUri);
}
#endif
}
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list