Hello community, here is the log from the commit of package kpeople5 for openSUSE:Factory checked in at 2019-09-23 12:25:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kpeople5 (Old) and /work/SRC/openSUSE:Factory/.kpeople5.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kpeople5" Mon Sep 23 12:25:27 2019 rev:56 rq:730950 version:5.62.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kpeople5/kpeople5.changes 2019-08-19 21:10:58.452837490 +0200 +++ /work/SRC/openSUSE:Factory/.kpeople5.new.7948/kpeople5.changes 2019-09-23 12:25:29.277727478 +0200 @@ -1,0 +2,14 @@ +Sat Sep 7 20:37:02 UTC 2019 - Christophe Giboudeaux <christo...@krop.fr> + +- Update to 5.62.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.62.0.php +- Changes since 5.61.0: + * Make it possible to delete contacts from backends + * Make it possible to modify contacts + * Replace by isEmpty() + * Include KDE* cmake macros first +- Replace foo-devel with cmake(KF5Foo) in build requirements + +------------------------------------------------------------------- Old: ---- kpeople-5.61.0.tar.xz kpeople-5.61.0.tar.xz.sig New: ---- kpeople-5.62.0.tar.xz kpeople-5.62.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kpeople5.spec ++++++ --- /var/tmp/diff_new_pack.Fo9zC5/_old 2019-09-23 12:25:29.717727406 +0200 +++ /var/tmp/diff_new_pack.Fo9zC5/_new 2019-09-23 12:25:29.721727406 +0200 @@ -17,14 +17,14 @@ %define rname kpeople -%define _tar_path 5.61 +%define _tar_path 5.62 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without lang Name: kpeople5 -Version: 5.61.0 +Version: 5.62.0 Release: 0 Summary: Library for access to contacts and identity holders License: LGPL-2.1-or-later @@ -37,12 +37,12 @@ %endif Source99: baselibs.conf BuildRequires: extra-cmake-modules >= %{_kf5_version} -BuildRequires: kcoreaddons-devel >= %{_kf5_version} BuildRequires: kf5-filesystem -BuildRequires: ki18n-devel >= %{_kf5_version} -BuildRequires: kitemviews-devel >= %{_kf5_version} -BuildRequires: kservice-devel >= %{_kf5_version} -BuildRequires: kwidgetsaddons-devel >= %{_kf5_version} +BuildRequires: cmake(KF5CoreAddons) >= %{_kf5_version} +BuildRequires: cmake(KF5I18n) >= %{_kf5_version} +BuildRequires: cmake(KF5ItemViews) >= %{_kf5_version} +BuildRequires: cmake(KF5Service) >= %{_kf5_version} +BuildRequires: cmake(KF5WidgetsAddons) >= %{_kf5_version} BuildRequires: cmake(Qt5DBus) >= 5.6.0 BuildRequires: cmake(Qt5Gui) >= 5.6.0 BuildRequires: cmake(Qt5Qml) >= 5.6.0 ++++++ kpeople-5.61.0.tar.xz -> kpeople-5.62.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/CMakeLists.txt new/kpeople-5.62.0/CMakeLists.txt --- old/kpeople-5.61.0/CMakeLists.txt 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/CMakeLists.txt 2019-09-07 16:48:39.000000000 +0200 @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.61.0") # handled by release scripts -set(KF5_DEP_VERSION "5.61.0") # handled by release scripts +set(KF5_VERSION "5.62.0") # handled by release scripts +set(KF5_DEP_VERSION "5.62.0") # handled by release scripts project (KPeople VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.61.0 NO_MODULE) +find_package(ECM 5.62.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) @@ -21,10 +21,13 @@ find_package(KF5ItemViews ${KF5_DEP_VERSION} CONFIG REQUIRED) find_package(KF5Service ${KF5_DEP_VERSION} CONFIG REQUIRED) +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) + include(ECMSetupVersion) include(ECMGenerateHeaders) include(ECMSetupVersion) -include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMAddTests) include(ECMAddQch) include(CMakePackageConfigHelpers) @@ -32,9 +35,6 @@ include(GenerateExportHeader) include(ECMQtDeclareLoggingCategory) -include(KDEInstallDirs) -include(KDECMakeSettings) - option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/po/ml/kpeople5.po new/kpeople-5.62.0/po/ml/kpeople5.po --- old/kpeople-5.61.0/po/ml/kpeople5.po 1970-01-01 01:00:00.000000000 +0100 +++ new/kpeople-5.62.0/po/ml/kpeople5.po 2019-09-07 16:48:39.000000000 +0200 @@ -0,0 +1,81 @@ +# Malayalam translations for kpeople package. +# Copyright (C) 2019 This file is copyright: +# This file is distributed under the same license as the kpeople package. +# Automatically generated, 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: kpeople\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2019-07-19 02:58+0200\n" +"PO-Revision-Date: 2019-07-19 02:58+0200\n" +"Last-Translator: Automatically generated\n" +"Language-Team: Swathanthra|സ്വതന്ത്ര Malayalam|മലയാളം Computing|കമ്പ്യൂട്ടിങ്ങ് <smc." +"org.in>\n" +"Language: ml\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: match.cpp:52 +#, kde-format +msgctxt "@title:column" +msgid "Name" +msgstr "" + +#: match.cpp:55 +#, kde-format +msgctxt "@title:column" +msgid "E-mail" +msgstr "" + +#: widgets/mergedelegate.cpp:97 +#, kde-format +msgctxt "reasons join" +msgid ", " +msgstr "" + +#: widgets/mergedelegate.cpp:97 +#, kde-format +msgctxt "name: merge reasons" +msgid "%1: %2" +msgstr "" + +#: widgets/mergedialog.cpp:63 +#, kde-format +msgid "Duplicates Manager" +msgstr "" + +#: widgets/mergedialog.cpp:72 +#, kde-format +msgid "Select contacts to be merged" +msgstr "" + +#. i18n: ectx: property (text), widget (QLabel, avatarPixmapLabel) +#: widgets/person-details-presentation.ui:43 +#, kde-format +msgid "Avatar" +msgstr "" + +#: widgets/plugins/emaildetailswidget.cpp:51 +#, kde-format +msgctxt "E-mail field label" +msgid "E-mail" +msgstr "" + +#: widgets/plugins/mergecontactswidget.cpp:48 +#, kde-format +msgid "Show Merge Suggestions..." +msgstr "" + +#: widgets/plugins/mergecontactswidget.cpp:86 +#, kde-format +msgid "Merge with Selected Contacts" +msgstr "" + +#: widgets/plugins/phonedetailswidget.cpp:37 +#, kde-format +msgctxt "Phone details title" +msgid "Phone" +msgstr "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/po/tg/kpeople5.po new/kpeople-5.62.0/po/tg/kpeople5.po --- old/kpeople-5.61.0/po/tg/kpeople5.po 1970-01-01 01:00:00.000000000 +0100 +++ new/kpeople-5.62.0/po/tg/kpeople5.po 2019-09-07 16:48:39.000000000 +0200 @@ -0,0 +1,80 @@ +# Copyright (C) YEAR This file is copyright: +# This file is distributed under the same license as the kpeople package. +# +# Victor Ibragimov <victor.ibragi...@gmail.com>, 2019. +msgid "" +msgstr "" +"Project-Id-Version: kpeople\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2019-07-19 02:58+0200\n" +"PO-Revision-Date: 2019-08-16 19:43+0500\n" +"Last-Translator: Victor Ibragimov <victor.ibragi...@gmail.com>\n" +"Language-Team: English <kde-i18n-...@kde.org>\n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 19.04.3\n" + +#: match.cpp:52 +#, kde-format +msgctxt "@title:column" +msgid "Name" +msgstr "Ном" + +#: match.cpp:55 +#, kde-format +msgctxt "@title:column" +msgid "E-mail" +msgstr "Почтаи электронӣ" + +#: widgets/mergedelegate.cpp:97 +#, kde-format +msgctxt "reasons join" +msgid ", " +msgstr ", " + +#: widgets/mergedelegate.cpp:97 +#, kde-format +msgctxt "name: merge reasons" +msgid "%1: %2" +msgstr "%1: %2" + +#: widgets/mergedialog.cpp:63 +#, kde-format +msgid "Duplicates Manager" +msgstr "Мудири нусхаҳои дуюм" + +#: widgets/mergedialog.cpp:72 +#, kde-format +msgid "Select contacts to be merged" +msgstr "Тамосҳоеро барои муттаҳидшавӣ интихоб намоед" + +#. i18n: ectx: property (text), widget (QLabel, avatarPixmapLabel) +#: widgets/person-details-presentation.ui:43 +#, kde-format +msgid "Avatar" +msgstr "Таҷассум" + +#: widgets/plugins/emaildetailswidget.cpp:51 +#, kde-format +msgctxt "E-mail field label" +msgid "E-mail" +msgstr "Почтаи электронӣ" + +#: widgets/plugins/mergecontactswidget.cpp:48 +#, kde-format +msgid "Show Merge Suggestions..." +msgstr "Нишон додани пешниҳодҳои муттаҳидшавӣ..." + +#: widgets/plugins/mergecontactswidget.cpp:86 +#, kde-format +msgid "Merge with Selected Contacts" +msgstr "Муттаҳидшавӣ бо тамосҳои интихобшуда" + +#: widgets/plugins/phonedetailswidget.cpp:37 +#, kde-format +msgctxt "Phone details title" +msgid "Phone" +msgstr "Телефон" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/po/zh_CN/kpeople5.po new/kpeople-5.62.0/po/zh_CN/kpeople5.po --- old/kpeople-5.61.0/po/zh_CN/kpeople5.po 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/po/zh_CN/kpeople5.po 2019-09-07 16:48:39.000000000 +0200 @@ -7,7 +7,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2019-07-19 02:58+0200\n" -"PO-Revision-Date: 2019-07-18 14:57\n" +"PO-Revision-Date: 2019-09-05 09:24\n" "Last-Translator: Guo Yunhe (guoyunhe)\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/backends/CMakeLists.txt new/kpeople-5.62.0/src/backends/CMakeLists.txt --- old/kpeople-5.61.0/src/backends/CMakeLists.txt 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/backends/CMakeLists.txt 2019-09-07 16:48:39.000000000 +0200 @@ -5,6 +5,7 @@ allcontactsmonitor.cpp defaultcontactmonitor.cpp abstractpersonaction.cpp + abstracteditablecontact.cpp ) add_library (KF5::PeopleBackend ALIAS KF5PeopleBackend) @@ -26,6 +27,7 @@ ecm_generate_headers(KPeopleBackend_CamelCase_HEADERS HEADER_NAMES AbstractContact + AbstractEditableContact AbstractPersonAction AllContactsMonitor BasePersonsDataSource diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/backends/abstractcontact.cpp new/kpeople-5.62.0/src/backends/abstractcontact.cpp --- old/kpeople-5.61.0/src/backends/abstractcontact.cpp 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/backends/abstractcontact.cpp 2019-09-07 16:48:39.000000000 +0200 @@ -27,6 +27,7 @@ const QString AbstractContact::PresenceProperty = QStringLiteral("presence"); const QString AbstractContact::AllEmailsProperty = QStringLiteral("all-email"); const QString AbstractContact::PictureProperty = QStringLiteral("picture"); +const QString AbstractContact::VCardProperty = QStringLiteral("vcard"); const QString AbstractContact::GroupsProperty = QStringLiteral("all-groups"); AbstractContact::AbstractContact() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/backends/abstractcontact.h new/kpeople-5.62.0/src/backends/abstractcontact.h --- old/kpeople-5.61.0/src/backends/abstractcontact.h 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/backends/abstractcontact.h 2019-09-07 16:48:39.000000000 +0200 @@ -74,6 +74,9 @@ /** QVariantList property that lists the emails the contact has */ static const QString AllEmailsProperty; + /** QByteArray with the raw vcard information */ + static const QString VCardProperty; + /** * Generic method to access a random contact property * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/backends/abstracteditablecontact.cpp new/kpeople-5.62.0/src/backends/abstracteditablecontact.cpp --- old/kpeople-5.61.0/src/backends/abstracteditablecontact.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kpeople-5.62.0/src/backends/abstracteditablecontact.cpp 2019-09-07 16:48:39.000000000 +0200 @@ -0,0 +1,26 @@ +/* + Copyright (C) 2019 Aleix Pol i Gonzalez <aleix...@blue-systems.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "abstracteditablecontact.h" + +using namespace KPeople; + +AbstractEditableContact::AbstractEditableContact() +{} + +AbstractEditableContact::~AbstractEditableContact() = default; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/backends/abstracteditablecontact.h new/kpeople-5.62.0/src/backends/abstracteditablecontact.h --- old/kpeople-5.61.0/src/backends/abstracteditablecontact.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kpeople-5.62.0/src/backends/abstracteditablecontact.h 2019-09-07 16:48:39.000000000 +0200 @@ -0,0 +1,60 @@ +/* + Copyright (C) 2019 Aleix Pol i Gonzalez <aleix...@blue-systems.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef KPEOPLE_ABSTRACT_EDITABLE_CONTACT_H +#define KPEOPLE_ABSTRACT_EDITABLE_CONTACT_H + +#include "abstractcontact.h" +#include <kpeoplebackend/kpeoplebackend_export.h> + +namespace KPeople +{ +/** + * @brief Additionally to @class AbstractContact features, it will allow us + * to suggest the backend property values for a said key. + * + * @since 5.62 + * @internal + */ + +class KPEOPLEBACKEND_EXPORT AbstractEditableContact : public AbstractContact +{ +public: + typedef QExplicitlySharedDataPointer<AbstractEditableContact> Ptr; + typedef QList<AbstractEditableContact::Ptr> List; + AbstractEditableContact(); + virtual ~AbstractEditableContact(); + + /** + * @p key @see AbstractContact for key identifiers + * @p value suggested value + * + * @returns whether the change was successful + */ + virtual bool setCustomProperty(const QString &key, const QVariant &value) = 0; + +private: + Q_DISABLE_COPY(AbstractEditableContact) +}; + +} + +Q_DECLARE_METATYPE(KPeople::AbstractEditableContact::List) +Q_DECLARE_METATYPE(KPeople::AbstractEditableContact::Ptr) + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/backends/basepersonsdatasource.cpp new/kpeople-5.62.0/src/backends/basepersonsdatasource.cpp --- old/kpeople-5.61.0/src/backends/basepersonsdatasource.cpp 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/backends/basepersonsdatasource.cpp 2019-09-07 16:48:39.000000000 +0200 @@ -49,28 +49,33 @@ Q_D(BasePersonsDataSource); //if there is currently no watcher, create one - AllContactsMonitorPtr c; - if (!d->m_allContactsMonitor.toStrongRef()) { + AllContactsMonitorPtr c = d->m_allContactsMonitor.toStrongRef(); + if (!c) { c = AllContactsMonitorPtr(createAllContactsMonitor()); d->m_allContactsMonitor = c; } - return d->m_allContactsMonitor.toStrongRef(); + return c; } ContactMonitorPtr BasePersonsDataSource::contactMonitor(const QString &contactUri) { Q_D(BasePersonsDataSource); - ContactMonitorPtr c; - if (!d->m_contactMonitors[contactUri].toStrongRef()) { + ContactMonitorPtr c = d->m_contactMonitors[contactUri].toStrongRef(); + if (!c) { c = ContactMonitorPtr(createContactMonitor(contactUri)); d->m_contactMonitors[contactUri] = c; } - return d->m_contactMonitors[contactUri].toStrongRef(); + return c; } ContactMonitor *BasePersonsDataSource::createContactMonitor(const QString &contactUri) { return new DefaultContactMonitor(contactUri, allContactsMonitor()); } + +BasePersonsDataSourceV2::BasePersonsDataSourceV2(QObject* parent, const QVariantList& args) + : BasePersonsDataSource(parent, args) +{ +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/backends/basepersonsdatasource.h new/kpeople-5.62.0/src/backends/basepersonsdatasource.h --- old/kpeople-5.61.0/src/backends/basepersonsdatasource.h 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/backends/basepersonsdatasource.h 2019-09-07 16:48:39.000000000 +0200 @@ -71,5 +71,15 @@ BasePersonsDataSourcePrivate *d_ptr; }; +class KPEOPLEBACKEND_EXPORT BasePersonsDataSourceV2 : public BasePersonsDataSource +{ + Q_OBJECT +public: + BasePersonsDataSourceV2(QObject *parent, const QVariantList &args = QVariantList()); + + virtual bool addContact(const QVariantMap &properties) = 0; + virtual bool deleteContact(const QString &uri) = 0; +}; + } #endif // BASE_PERSONS_DATA_SOURCE_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/declarative/peopleqmlplugin.cpp new/kpeople-5.62.0/src/declarative/peopleqmlplugin.cpp --- old/kpeople-5.61.0/src/declarative/peopleqmlplugin.cpp 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/declarative/peopleqmlplugin.cpp 2019-09-07 16:48:39.000000000 +0200 @@ -23,6 +23,7 @@ #include <personactionsmodel_p.h> #include <persondata.h> #include <personssortfilterproxymodel.h> +#include <personpluginmanager.h> #include <actions.h> #include "declarativepersondata.h" @@ -43,6 +44,18 @@ Q_ENUM(ActionType) }; +class DeclarativePersonPluginManager : public QObject +{ + Q_OBJECT +public: + Q_SCRIPTABLE bool addContact(const QVariantMap &properties) { + return KPeople::PersonPluginManager::addContact(properties); + } + Q_SCRIPTABLE bool deleteContact(const QString &uri) { + return KPeople::PersonPluginManager::deleteContact(uri); + } +}; + void PeopleQMLPlugin::registerTypes(const char *uri) { qmlRegisterType<KPeople::PersonsModel>(uri, 1, 0, "PersonsModel"); @@ -51,6 +64,7 @@ qmlRegisterType<DeclarativePersonData>(uri, 1, 0, "PersonData"); qmlRegisterType<KPeople::PersonData>(); qmlRegisterUncreatableType<ActionTypeWrapper>(uri, 1, 0, "ActionType", QStringLiteral("You cannot create ActionType")); + qmlRegisterSingletonType<DeclarativePersonPluginManager>(uri, 1, 0, "PersonPluginManager", [] (QQmlEngine*, QJSEngine*) -> QObject* { return new DeclarativePersonPluginManager; }); } #include "peopleqmlplugin.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/global.h new/kpeople-5.62.0/src/global.h --- old/kpeople-5.61.0/src/global.h 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/global.h 2019-09-07 16:48:39.000000000 +0200 @@ -21,6 +21,7 @@ #include <QString> #include <QStringList> +#include <QVariantMap> #include <kpeople/kpeople_export.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/persondata.cpp new/kpeople-5.62.0/src/persondata.cpp --- old/kpeople-5.61.0/src/persondata.cpp 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/persondata.cpp 2019-09-07 16:48:39.000000000 +0200 @@ -24,6 +24,7 @@ #include "backends/basepersonsdatasource.h" #include "backends/contactmonitor.h" #include "backends/abstractcontact.h" +#include "backends/abstracteditablecontact.h" #include <QUrl> #include "kpeople_debug.h" @@ -155,6 +156,14 @@ return d->metaContact.personAddressee()->customProperty(key); } +bool KPeople::PersonData::setContactCustomProperty(const QString& key, const QVariant& value) +{ + Q_D(PersonData); + auto contact = dynamic_cast<AbstractEditableContact*>(d->metaContact.personAddressee().data()); + + return contact && contact->setCustomProperty(key, value); +} + QString PersonData::presenceIconName() const { QString contactPresence = contactCustomProperty(QStringLiteral("telepathy-presence")).toString(); @@ -207,3 +216,8 @@ return ret; } +bool KPeople::PersonData::isEditable() const +{ + Q_D(const PersonData); + return dynamic_cast<const AbstractEditableContact*>(d->metaContact.personAddressee().constData()); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/persondata.h new/kpeople-5.62.0/src/persondata.h --- old/kpeople-5.61.0/src/persondata.h 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/persondata.h 2019-09-07 16:48:39.000000000 +0200 @@ -50,6 +50,13 @@ Q_PROPERTY(QPixmap photo READ photo NOTIFY dataChanged) Q_PROPERTY(QString presenceIconName READ presenceIconName NOTIFY dataChanged) + /** + * @returns whether setContactCustomProperty can be called on this contact + * + * @since 5.62 + */ + Q_PROPERTY(bool isEditable READ isEditable CONSTANT) + public: /** Creates a Person object from a given ID. * The ID can be either a local application specific ID (such as akonadi://?item=15) @@ -94,6 +101,17 @@ Q_SCRIPTABLE QVariant contactCustomProperty(const QString &key) const; /** + * Sends a desired @p value for the contact according to the @p key. + * It's not necessarily implemented. The back-end gets to decide whether a property + * can be set or not. + * + * @returns whether the property value was changed + * + * @since 5.62 + */ + Q_SCRIPTABLE bool setContactCustomProperty(const QString &key, const QVariant &value); + + /** * Returns the contact's online presence. */ QString presence() const; @@ -114,6 +132,13 @@ /** Returns all e-mail addresses from the person. */ QStringList allEmails() const; + /** + * @returns whether the contact can be edited. + * + * @since 5.62 + */ + bool isEditable() const; + // struct PhoneNumber { // QString name; // QString number; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/personmanager.cpp new/kpeople-5.62.0/src/personmanager.cpp --- old/kpeople-5.61.0/src/personmanager.cpp 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/personmanager.cpp 2019-09-07 16:48:39.000000000 +0200 @@ -154,7 +154,7 @@ // - if we're merging two simple contacts, create completely new id // - if we're merging an existing metacontact, take the first id and use it QString personUriString; - if (metacontacts.count() == 0) { + if (metacontacts.isEmpty()) { // query for the highest existing ID in the database and +1 it int personUri = 0; QSqlQuery query = m_db.exec(QStringLiteral("SELECT MAX(personID) FROM persons")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/personmanager_p.h new/kpeople-5.62.0/src/personmanager_p.h --- old/kpeople-5.61.0/src/personmanager_p.h 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/personmanager_p.h 2019-09-07 16:48:39.000000000 +0200 @@ -66,6 +66,14 @@ */ QStringList contactsForPersonUri(const QString &personUri) const; + /** + * Creates a contact with the specified @p properties + * + * @since 5.62 + */ + + bool addContact(const QVariantMap &properties); + public Q_SLOTS: //merge all ids (person IDs and contactUris into a single person) //returns the ID that will be created diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/personpluginmanager.cpp new/kpeople-5.62.0/src/personpluginmanager.cpp --- old/kpeople-5.61.0/src/personpluginmanager.cpp 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/personpluginmanager.cpp 2019-09-07 16:48:39.000000000 +0200 @@ -135,3 +135,29 @@ } return s_instance->dataSourcePlugins.value(sourceId); } + +bool KPeople::PersonPluginManager::addContact(const QVariantMap& properties) +{ + bool ret = false; + for (auto p : qAsConst(s_instance->dataSourcePlugins)) { + auto v2 = dynamic_cast<BasePersonsDataSourceV2*>(p); + if (!v2) + continue; + const bool added = v2->addContact(properties); + ret |= added; + } + return ret; +} + +bool KPeople::PersonPluginManager::deleteContact(const QString &uri) +{ + bool ret = false; + for (auto p : qAsConst(s_instance->dataSourcePlugins)) { + auto v2 = dynamic_cast<BasePersonsDataSourceV2*>(p); + if (!v2) + continue; + const bool deleted = v2->deleteContact(uri); + ret |= deleted; + } + return ret; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.61.0/src/personpluginmanager.h new/kpeople-5.62.0/src/personpluginmanager.h --- old/kpeople-5.61.0/src/personpluginmanager.h 2019-08-03 21:57:28.000000000 +0200 +++ new/kpeople-5.62.0/src/personpluginmanager.h 2019-09-07 16:48:39.000000000 +0200 @@ -23,6 +23,7 @@ #include <kpeople/kpeople_export.h> +#include <QVariant> #include <QHash> namespace KPeople @@ -68,6 +69,22 @@ * This is for unit tests only */ static void setDataSourcePlugins(const QHash<QString, BasePersonsDataSource *> &dataSources); + + /** + * Creates a contact with the specified @p properties + * @returns if it could be done successfully + * + * @since 5.62 + */ + static bool addContact(const QVariantMap &properties); + + /** + * Deletes a contact with the specified &p uri + * @returns if it could be done successfully + * + * @since 5.62 + */ + static bool deleteContact(const QString &uri); }; }