Hello community, here is the log from the commit of package kpeople5 for openSUSE:Factory checked in at 2016-03-16 10:31:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kpeople5 (Old) and /work/SRC/openSUSE:Factory/.kpeople5.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kpeople5" Changes: -------- --- /work/SRC/openSUSE:Factory/kpeople5/kpeople5.changes 2016-02-24 18:56:46.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kpeople5.new/kpeople5.changes 2016-03-16 10:31:17.000000000 +0100 @@ -1,0 +2,12 @@ +Sun Mar 6 10:00:59 UTC 2016 - [email protected] + +- Update to 5.20.0 (boo#970856) + * Fix deprecated API usage + * Add actionType to the declarative plugin + * Reverse the filtering logic in PersonsSortFilterProxyModel + * Make the QML example slightly more usable + * Add actionType to the PersonActionsModel + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.20.0.php + +------------------------------------------------------------------- Old: ---- kpeople-5.19.0.tar.xz New: ---- kpeople-5.20.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kpeople5.spec ++++++ --- /var/tmp/diff_new_pack.49xhRC/_old 2016-03-16 10:31:18.000000000 +0100 +++ /var/tmp/diff_new_pack.49xhRC/_new 2016-03-16 10:31:18.000000000 +0100 @@ -18,9 +18,9 @@ %bcond_without lang %define rname kpeople -%define _tar_path 5.19 +%define _tar_path 5.20 Name: kpeople5 -Version: 5.19.0 +Version: 5.20.0 Release: 0 %define kf5_version %{version} BuildRequires: extra-cmake-modules >= %{_tar_path} ++++++ kpeople-5.19.0.tar.xz -> kpeople-5.20.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/CMakeLists.txt new/kpeople-5.20.0/CMakeLists.txt --- old/kpeople-5.19.0/CMakeLists.txt 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/CMakeLists.txt 2016-03-06 15:40:39.000000000 +0100 @@ -3,14 +3,14 @@ project (KPeople) include(FeatureSummary) -find_package(ECM 5.19.0 NO_MODULE) +find_package(ECM 5.20.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) -set(KF5_VERSION "5.19.0") # handled by release scripts -set(KF5_DEP_VERSION "5.19.0") # handled by release scripts +set(KF5_VERSION "5.20.0") # handled by release scripts +set(KF5_DEP_VERSION "5.20.0") # handled by release scripts set(REQUIRED_QT_VERSION 5.3.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/autotests/fakecontactsource.cpp new/kpeople-5.20.0/autotests/fakecontactsource.cpp --- old/kpeople-5.19.0/autotests/fakecontactsource.cpp 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/autotests/fakecontactsource.cpp 2016-03-06 15:40:39.000000000 +0100 @@ -99,7 +99,8 @@ { KPeople::AbstractContact::Ptr contact4(new FakeContact(QVariantMap { { KPeople::AbstractContact::NameProperty, QStringLiteral("Contact 4") }, - { KPeople::AbstractContact::EmailProperty, QStringLiteral("[email protected]") } + { KPeople::AbstractContact::EmailProperty, QStringLiteral("[email protected]") }, + { KPeople::AbstractContact::PresenceProperty, QStringLiteral("online") } })); contacts[QStringLiteral("fakesource://contact4")] = contact4; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/autotests/personsproxymodeltest.cpp new/kpeople-5.20.0/autotests/personsproxymodeltest.cpp --- old/kpeople-5.19.0/autotests/personsproxymodeltest.cpp 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/autotests/personsproxymodeltest.cpp 2016-03-06 15:40:39.000000000 +0100 @@ -72,4 +72,8 @@ proxy.setRequiredProperties(QStringList() << AbstractContact::PhoneNumberProperty); QCOMPARE(proxy.rowCount(), 2); + + proxy.setRequiredProperties(QStringList() << AbstractContact::PhoneNumberProperty << KPeople::AbstractContact::PresenceProperty); + + QCOMPARE(proxy.rowCount(), 3); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/examples/qml/Main.qml new/kpeople-5.20.0/examples/qml/Main.qml --- old/kpeople-5.19.0/examples/qml/Main.qml 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/examples/qml/Main.qml 2016-03-06 15:40:39.000000000 +0100 @@ -1,5 +1,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 +import QtQuick.Layouts 1.1 import org.kde.people 1.0 import org.kde.plasma.components 2.0 import org.kde.plasma.core 2.0 as Core @@ -7,9 +8,8 @@ import org.kde.kquickcontrolsaddons 2.0 ApplicationWindow { - width: 300 - height: 300 - color: "red" + width: 640 + height: 480 visible: true Core.SortFilterModel { @@ -47,20 +47,21 @@ top: parent.top right: view.right } + ListModel { id: toMergeItems function uriIndex(uri) { var ret = -1 - for(var i=0; i<count && ret<0; ++i) { - if(get(i).uri==uri) - ret=i + for (var i = 0; i < count && ret < 0; ++i) { + if (get(i).uri == uri) + ret = i; } return ret } function addUri(uri, name) { - if(uriIndex(uri)<0) + if (uriIndex(uri) < 0) toMergeItems.append({ "uri": uri, "name": name }) } @@ -91,30 +92,41 @@ cellWidth: 100 cellHeight: 100 model: filteredPeople - delegate: ListItem { - clip: true - height: view.cellHeight - width: view.cellWidth-5 - Core.IconItem { - id: avatar - source: decoration - anchors.fill: parent - } - Label { - width: parent.width - height: parent.height - text: display - wrapMode: Text.WrapAnywhere - visible: avatar.status!=Image.Ready - } - enabled: true - onClicked: { - contactItem.contactData = model - personActions.personUri = model.personUri - if(areWeMerging.checked) - toMergeItems.addUri(model.personUri, model.display) - } - } + delegate: ListItem { + height: view.cellHeight + width: view.cellWidth - 5 + + clip: true + enabled: true + + ColumnLayout { + anchors.fill: parent + + Core.IconItem { + id: avatar + Layout.fillWidth: true + Layout.fillHeight: true + + source: decoration + } + Label { + width: parent.width + text: display + wrapMode: Text.WrapAnywhere + elide: Text.ElideMiddle + visible: avatar.status!=Image.Ready + } + } + + onClicked: { + contactItem.contactData = model + personActions.personUri = model.personUri + + if (areWeMerging.checked) { + toMergeItems.addUri(model.personUri, model.display) + } + } + } } Flickable { @@ -127,16 +139,26 @@ width: parent.width/2 property variant contactData - Column { + ColumnLayout { width: parent.width spacing: 5 + Column { - visible: toMergeItems.count>0 - Label { text: "To Merge:" } + Layout.fillWidth: true + visible: toMergeItems.count > 0 + + Label { + text: "Contacts To Merge:" + } + Repeater { - model:toMergeItems - delegate: Label { text: name + " - " + uri } + model: toMergeItems + delegate: Label { + width: parent.width + text: name + " - " + uri + } } + Button { text: "Merge!" onClicked: { @@ -144,6 +166,26 @@ toMergeItems.clear() } } + + Rectangle { + width: parent.width + height: 1 + color: "#888" + } + } + + + RowLayout { + Core.IconItem { + id: avatar + height: 64 + width: height + source: contactItem.contactData ? contactItem.contactData.decoration : null + } + + Label { + text: contactItem.contactData ? contactItem.contactData.display : "" + } } Label { @@ -153,47 +195,36 @@ function dataToString(data) { var text = "" - if(data==null) - return "<null>"; - else for(var a in data) { - text += a + ": "; - var curr = data[a] - if(curr==null) - text += "null" - else - text += curr - text += '\n' - } - return text - } - } - ToolBar { - width: parent.width - height: 30 - Flow { - anchors.fill: parent - Repeater { - model: PersonActions { - id: personActions - } - delegate: Button { - text: model.display - iconSource: model.decoration - onClicked: personActions.triggerAction(model.index) + if (data != null) { + for (var prop in data) { + text += prop + ": "; + var currentData = data[prop] + text += currentData == null ? "null" : currentData + text += '\n' } } + + return text } } - Rectangle { color: "green"; width: parent.width; height: 5 } - Row { + + Flow { + Layout.fillWidth: true + Layout.fillHeight: true + Repeater { - model: contactItem.contactData ? contactItem.contactData.photo : null - delegate: Image { - source: modelData + width: parent.width + model: PersonActions { + id: personActions + } + delegate: Button { + text: model.display + iconSource: model.iconName + onClicked: personActions.triggerAction(model.index) } } } - Rectangle { color: "blue"; width: parent.width; height: 5} + Button { text: "Unmerge" visible: contactItem.contactData!=null && contactItem.contactData.contactsCount>1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/src/declarative/peopleqmlplugin.cpp new/kpeople-5.20.0/src/declarative/peopleqmlplugin.cpp --- old/kpeople-5.19.0/src/declarative/peopleqmlplugin.cpp 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/src/declarative/peopleqmlplugin.cpp 2016-03-06 15:40:39.000000000 +0100 @@ -23,10 +23,26 @@ #include <personactionsmodel_p.h> #include <persondata.h> #include <personssortfilterproxymodel.h> +#include <actions.h> #include "declarativepersondata.h" #include <QtQml/qqml.h> +class ActionTypeWrapper : public QObject { + Q_OBJECT + +public: + enum ActionType { + TextChatAction = KPeople::TextChatAction, + AudioCallAction = KPeople::AudioCallAction, + VideoCallAction = KPeople::VideoCallAction, + SendEmailAction = KPeople::SendEmailAction, + SendFileAction = KPeople::SendFileAction, + OtherAction = KPeople::OtherAction + }; + Q_ENUMS(ActionType) +}; + void PeopleQMLPlugin::registerTypes(const char *uri) { qmlRegisterType<KPeople::PersonsModel>(uri, 1, 0, "PersonsModel"); @@ -34,4 +50,7 @@ qmlRegisterType<KPeople::PersonActionsModel>(uri, 1, 0, "PersonActions"); qmlRegisterType<DeclarativePersonData>(uri, 1, 0, "PersonData"); qmlRegisterType<KPeople::PersonData>(); + qmlRegisterUncreatableType<ActionTypeWrapper>(uri, 1, 0, "ActionType", QStringLiteral("You cannot create ActionType")); } + +#include "peopleqmlplugin.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/src/declarative/personactionsmodel.cpp new/kpeople-5.20.0/src/declarative/personactionsmodel.cpp --- old/kpeople-5.19.0/src/declarative/personactionsmodel.cpp 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/src/declarative/personactionsmodel.cpp 2016-03-06 15:40:39.000000000 +0100 @@ -54,6 +54,7 @@ QHash<int, QByteArray> roles = QAbstractListModel::roleNames(); roles[IconNameRole] = "iconName"; roles[ActionRole] = "action"; + roles[ActionTypeRole] = "actionType"; return roles; } @@ -114,6 +115,8 @@ return d->actions[index.row()]->icon().name(); case ActionRole: return QVariant::fromValue<QObject *>(d->actions[index.row()]); + case ActionTypeRole: + return d->actions[index.row()]->property("actionType"); } return QVariant(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/src/declarative/personactionsmodel_p.h new/kpeople-5.20.0/src/declarative/personactionsmodel_p.h --- old/kpeople-5.19.0/src/declarative/personactionsmodel_p.h 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/src/declarative/personactionsmodel_p.h 2016-03-06 15:40:39.000000000 +0100 @@ -38,7 +38,8 @@ public: enum Roles { IconNameRole = Qt::UserRole + 1, - ActionRole + ActionRole, + ActionTypeRole }; PersonActionsModel(QObject *parent = 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/src/personssortfilterproxymodel.cpp new/kpeople-5.20.0/src/personssortfilterproxymodel.cpp --- old/kpeople-5.19.0/src/personssortfilterproxymodel.cpp 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/src/personssortfilterproxymodel.cpp 2016-03-06 15:40:39.000000000 +0100 @@ -58,12 +58,19 @@ const AbstractContact::Ptr contact = idx.data(KPeople::PersonsModel::PersonVCardRole).value<AbstractContact::Ptr>(); Q_ASSERT(contact); + + // Don't filter if no keys are set + if (d->m_keys.isEmpty()) { + return true; + } + foreach(const QString &key, d->m_keys) { - if (contact->customProperty(key).isNull()) - return false; + if (!contact->customProperty(key).isNull()) { + return true; + } } - return true; + return false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.19.0/src/widgets/actions.cpp new/kpeople-5.20.0/src/widgets/actions.cpp --- old/kpeople-5.19.0/src/widgets/actions.cpp 2016-02-06 14:54:15.000000000 +0100 +++ new/kpeople-5.20.0/src/widgets/actions.cpp 2016-03-06 15:40:39.000000000 +0100 @@ -18,6 +18,7 @@ #include "actions.h" #include <QAction> +#include <QDebug> #include <KPluginLoader> #include <KPluginFactory> #include <KPluginMetaData> @@ -35,7 +36,11 @@ Q_FOREACH (const KPluginMetaData &service, personPluginList) { KPluginLoader loader(service.fileName()); KPluginFactory *factory = loader.factory(); - AbstractPersonAction *plugin = qobject_cast<AbstractPersonAction*>(factory->create()); + if (!factory) { + qWarning() << "Couldn't create the factory for" << service.name() << "at" << service.fileName(); + continue; + } + AbstractPersonAction *plugin = factory->create<AbstractPersonAction>(); if (plugin) { // qDebug() << "found plugin" << service->name(); actionPlugins << plugin;
