Hello community, here is the log from the commit of package kpeople5 for openSUSE:Factory checked in at 2018-10-22 11:14:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kpeople5 (Old) and /work/SRC/openSUSE:Factory/.kpeople5.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kpeople5" Mon Oct 22 11:14:46 2018 rev:44 rq:642339 version:5.51.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kpeople5/kpeople5.changes 2018-10-01 08:08:18.910291804 +0200 +++ /work/SRC/openSUSE:Factory/.kpeople5.new/kpeople5.changes 2018-10-22 11:14:49.415689346 +0200 @@ -1,0 +2,21 @@ +Tue Oct 16 08:02:31 UTC 2018 - Luca Beltrame <[email protected]> + +- Run spec-cleaner + +------------------------------------------------------------------- +Mon Oct 15 11:50:37 UTC 2018 - [email protected] + +- Update to 5.51.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.51.0.php +- Changes since 5.50.0: + * Fix signals not being emitted when merging two persons + * Don't crash if person gets removed + * Define PersonActionsPrivate as class, as declared before + * Make PersonPluginManager API public + * Fix CMakeLists.txt issues + * Fix minor EBN issues + * Add loging categories + +------------------------------------------------------------------- Old: ---- kpeople-5.50.0.tar.xz New: ---- kpeople-5.51.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kpeople5.spec ++++++ --- /var/tmp/diff_new_pack.BoEgjv/_old 2018-10-22 11:14:50.091688613 +0200 +++ /var/tmp/diff_new_pack.BoEgjv/_new 2018-10-22 11:14:50.091688613 +0200 @@ -12,33 +12,33 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define rname kpeople -%define _tar_path 5.50 +%define _tar_path 5.51 # 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.50.0 +Version: 5.51.0 Release: 0 Summary: Provides access to all contacts and the people who hold them License: LGPL-2.1-or-later Group: Development/Libraries/KDE -URL: http://www.kde.org +URL: https://www.kde.org Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{rname}-%{version}.tar.xz Source1: baselibs.conf -BuildRequires: extra-cmake-modules >= %{_tar_path} -BuildRequires: kcoreaddons-devel >= %{_tar_path} +BuildRequires: extra-cmake-modules >= %{_kf5_version} +BuildRequires: kcoreaddons-devel >= %{_kf5_version} BuildRequires: kf5-filesystem -BuildRequires: ki18n-devel >= %{_tar_path} -BuildRequires: kitemviews-devel >= %{_tar_path} -BuildRequires: kservice-devel >= %{_tar_path} -BuildRequires: kwidgetsaddons-devel >= %{_tar_path} +BuildRequires: ki18n-devel >= %{_kf5_version} +BuildRequires: kitemviews-devel >= %{_kf5_version} +BuildRequires: kservice-devel >= %{_kf5_version} +BuildRequires: kwidgetsaddons-devel >= %{_kf5_version} BuildRequires: cmake(Qt5DBus) >= 5.6.0 BuildRequires: cmake(Qt5Gui) >= 5.6.0 BuildRequires: cmake(Qt5Qml) >= 5.6.0 @@ -87,11 +87,12 @@ %files %license COPYING -%{_kf5_libdir}/libKF5People*.so.* %dir %{_kf5_datadir} +%{_kf5_debugdir}/kpeople.categories %{_kf5_datadir}/kpeople/ -%{_kf5_servicetypesdir}/ +%{_kf5_libdir}/libKF5People*.so.* %{_kf5_qmldir}/ +%{_kf5_servicetypesdir}/ %files devel %license COPYING ++++++ kpeople-5.50.0.tar.xz -> kpeople-5.51.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/CMakeLists.txt new/kpeople-5.51.0/CMakeLists.txt --- old/kpeople-5.50.0/CMakeLists.txt 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/CMakeLists.txt 2018-10-08 10:19:40.000000000 +0200 @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.50.0") # handled by release scripts -set(KF5_DEP_VERSION "5.50.0") # handled by release scripts +set(KF5_VERSION "5.51.0") # handled by release scripts +set(KF5_DEP_VERSION "5.51.0") # handled by release scripts project (KPeople VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.50.0 NO_MODULE) +find_package(ECM 5.51.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) @@ -30,6 +30,7 @@ include(CMakePackageConfigHelpers) include(ECMGeneratePriFile) include(GenerateExportHeader) +include(ECMQtDeclareLoggingCategory) include(KDEInstallDirs) include(KDECMakeSettings) @@ -82,4 +83,5 @@ DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) +install( FILES kpeople.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/autotests/persondatatests.cpp new/kpeople-5.51.0/autotests/persondatatests.cpp --- old/kpeople-5.50.0/autotests/persondatatests.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/autotests/persondatatests.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -25,10 +25,10 @@ //private includes #include "personmanager_p.h" -#include "personpluginmanager_p.h" //public kpeople includes #include <persondata.h> +#include <personpluginmanager.h> #include "fakecontactsource.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/autotests/personsmodeltest.cpp new/kpeople-5.51.0/autotests/personsmodeltest.cpp --- old/kpeople-5.50.0/autotests/personsmodeltest.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/autotests/personsmodeltest.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -26,10 +26,10 @@ //private includes #include "personmanager_p.h" -#include "personpluginmanager_p.h" //public kpeople includes #include <personsmodel.h> +#include <personpluginmanager.h> #include "fakecontactsource.h" @@ -150,7 +150,7 @@ QCOMPARE(modelRowsInsert.count(), 1); QCOMPARE(modelRowsInsert.first().at(0).toModelIndex(), QModelIndex()); - // Similarily, there must be one row removed and the parent must be + // Similarly, there must be one row removed and the parent must be // the old Person index QCOMPARE(modelRowsRemove.count(), 1); QCOMPARE(modelRowsRemove.first().at(0).toModelIndex(), personIndex); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/autotests/personsproxymodeltest.cpp new/kpeople-5.51.0/autotests/personsproxymodeltest.cpp --- old/kpeople-5.50.0/autotests/personsproxymodeltest.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/autotests/personsproxymodeltest.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -26,10 +26,10 @@ //private includes #include "personmanager_p.h" -#include "personpluginmanager_p.h" //public kpeople includes #include <personsmodel.h> +#include <personpluginmanager.h> #include <personssortfilterproxymodel.h> #include "fakecontactsource.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/kpeople.categories new/kpeople-5.51.0/kpeople.categories --- old/kpeople-5.50.0/kpeople.categories 1970-01-01 01:00:00.000000000 +0100 +++ new/kpeople-5.51.0/kpeople.categories 2018-10-08 10:19:40.000000000 +0200 @@ -0,0 +1,3 @@ +kf5.kpeople kpeople lib IDENTIFIER [KPEOPLE_LOG] +kf5.kpeople.plugin.akonadi kpeople akonadi plugin IDENTIFIER [KPEOPLE_AKONADI_PLUGIN_LOG] +kf5.kpeople.widgets kpeople widgets IDENTIFIER [KPEOPLE_WIDGETS_LOG] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/po/zh_CN/kpeople5.po new/kpeople-5.51.0/po/zh_CN/kpeople5.po --- old/kpeople-5.50.0/po/zh_CN/kpeople5.po 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/po/zh_CN/kpeople5.po 2018-10-08 10:19:40.000000000 +0200 @@ -7,8 +7,8 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2018-08-16 09:05+0200\n" -"PO-Revision-Date: 2018-08-30 13:09\n" -"Last-Translator: guoyunhebrave <[email protected]>\n" +"PO-Revision-Date: 2018-09-28 19:47\n" +"Last-Translator: guoyunhe <[email protected]>\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/CMakeLists.txt new/kpeople-5.51.0/src/CMakeLists.txt --- old/kpeople-5.50.0/src/CMakeLists.txt 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/CMakeLists.txt 2018-10-08 10:19:40.000000000 +0200 @@ -7,7 +7,10 @@ add_subdirectory(widgets) add_subdirectory(backends) +ecm_qt_declare_logging_category(KF5People_debug_SRCS HEADER kpeople_debug.h IDENTIFIER KPEOPLE_LOG CATEGORY_NAME kf5.kpeople) + add_library (KF5People + ${KF5People_debug_SRCS} global.cpp metacontact.cpp persondata.cpp @@ -19,6 +22,7 @@ personmanager.cpp personssortfilterproxymodel.cpp ) + add_library(KF5::People ALIAS KF5People) target_link_libraries (KF5People @@ -53,6 +57,7 @@ ecm_generate_headers(KPeople_CamelCase_HEADERS HEADER_NAMES PersonData + PersonPluginManager PersonsModel Global REQUIRED_HEADERS KPeople_HEADERS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/backends/abstractcontact.h new/kpeople-5.51.0/src/backends/abstractcontact.h --- old/kpeople-5.50.0/src/backends/abstractcontact.h 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/backends/abstractcontact.h 2018-10-08 10:19:40.000000000 +0200 @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef KPEOPLE_CONTACT -#define KPEOPLE_CONTACT +#ifndef KPEOPLE_ABSTRACT_CONTACT_H +#define KPEOPLE_ABSTRACT_CONTACT_H #include <QSharedData> #include <QVariant> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/declarative/declarativepersondata.cpp new/kpeople-5.51.0/src/declarative/declarativepersondata.cpp --- old/kpeople-5.50.0/src/declarative/declarativepersondata.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/declarative/declarativepersondata.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -18,7 +18,7 @@ #include "declarativepersondata.h" -#include <QDebug> +#include "kpeople_debug.h" #include "../persondata.h" DeclarativePersonData::DeclarativePersonData(QObject *parent) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/declarative/personactionsmodel.cpp new/kpeople-5.51.0/src/declarative/personactionsmodel.cpp --- old/kpeople-5.50.0/src/declarative/personactionsmodel.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/declarative/personactionsmodel.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -17,15 +17,17 @@ */ #include "personactionsmodel_p.h" -#include <kpeople/persondata.h> -#include <kpeople/actions.h> +#include "persondata.h" +#include "widgets/actions.h" #include <QAction> -#include <QDebug> +#include "kpeople_debug.h" #include <QPointer> namespace KPeople { -struct PersonActionsPrivate { +class PersonActionsPrivate +{ +public: PersonActionsPrivate() : person(nullptr) {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/duplicatesfinder.cpp new/kpeople-5.51.0/src/duplicatesfinder.cpp --- old/kpeople-5.50.0/src/duplicatesfinder.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/duplicatesfinder.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -20,7 +20,7 @@ #include "personsmodel.h" #include <QUrl> -#include <QDebug> +#include "kpeople_debug.h" using namespace KPeople; @@ -54,7 +54,7 @@ m_matches.clear(); if (m_model->rowCount() == 0) { - qWarning() << "finding duplicates on empty model!"; + qCWarning(KPEOPLE_LOG) << "finding duplicates on empty model!"; } for (int i = 0, rows = m_model->rowCount(); i < rows; i++) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/global.cpp new/kpeople-5.51.0/src/global.cpp --- old/kpeople-5.50.0/src/global.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/global.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -19,7 +19,7 @@ #include "global.h" #include "personmanager_p.h" -#include "personpluginmanager_p.h" +#include "personpluginmanager.h" #include "backends/abstractcontact.h" //these namespace members expose the useful bits of PersonManager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/matchessolver.cpp new/kpeople-5.51.0/src/matchessolver.cpp --- old/kpeople-5.50.0/src/matchessolver.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/matchessolver.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -22,7 +22,7 @@ #include "personsmodel.h" #include "personmanager_p.h" #include <QString> -#include <QDebug> +#include "kpeople_debug.h" using namespace KPeople; @@ -86,7 +86,7 @@ Q_FOREACH (const QSet<QString> &uris, jobsData) { if (PersonManager::instance()->mergeContacts(uris.toList()).isEmpty()) { - qWarning() << "error: failing to merge contacts: " << uris; + qCWarning(KPEOPLE_LOG) << "error: failing to merge contacts: " << uris; } } emitResult(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/metacontact.cpp new/kpeople-5.51.0/src/metacontact.cpp --- old/kpeople-5.50.0/src/metacontact.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/metacontact.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -19,7 +19,7 @@ #include "metacontact_p.h" #include "global.h" #include <QSharedData> -#include <QDebug> +#include "kpeople_debug.h" #include <QSet> namespace KPeople @@ -162,7 +162,7 @@ if (index >= 0) { reload(); } else { - qWarning() << "Inserting an already-present contact" << contactUri; + qCWarning(KPEOPLE_LOG) << "Inserting an already-present contact" << contactUri; } return index; } @@ -186,7 +186,7 @@ const int index = d->contactUris.indexOf(contactUri); Q_ASSERT(index < 0 || d->contacts[index] == contact); if (index < 0) { - qWarning() << "contact not part of the metacontact"; + qCWarning(KPEOPLE_LOG) << "contact not part of the metacontact"; } return index; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/persondata.cpp new/kpeople-5.51.0/src/persondata.cpp --- old/kpeople-5.50.0/src/persondata.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/persondata.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -20,13 +20,13 @@ #include "metacontact_p.h" #include "personmanager_p.h" -#include "personpluginmanager_p.h" +#include "personpluginmanager.h" #include "backends/basepersonsdatasource.h" #include "backends/contactmonitor.h" #include "backends/abstractcontact.h" #include <QUrl> -#include <QDebug> +#include "kpeople_debug.h" #include <QStandardPaths> namespace KPeople @@ -83,7 +83,7 @@ } connect(cw.data(), SIGNAL(contactChanged()), SLOT(onContactChanged())); } else - qWarning() << "error: creating PersonData for unknown contact" << contactUri << id; + qCWarning(KPEOPLE_LOG) << "error: creating PersonData for unknown contact" << contactUri << id; } if (personUri.isEmpty() && contacts.size() == 1) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/personmanager.cpp new/kpeople-5.51.0/src/personmanager.cpp --- old/kpeople-5.50.0/src/personmanager.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/personmanager.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -20,7 +20,7 @@ #include "personmanager_p.h" #include <QVariant> -#include <QDebug> +#include "kpeople_debug.h" #include <QStandardPaths> #include <QDir> #include <QSqlError> @@ -64,7 +64,7 @@ { m_db.setDatabaseName(databasePath); if (!m_db.open()) { - qWarning() << "Couldn't open the database at" << databasePath; + qCWarning(KPEOPLE_LOG) << "Couldn't open the database at" << databasePath; } m_db.exec(QStringLiteral("CREATE TABLE IF NOT EXISTS persons (contactID VARCHAR UNIQUE NOT NULL, personID INT NOT NULL)")); m_db.exec(QStringLiteral("CREATE INDEX IF NOT EXISTS contactIdIndex ON persons (contactId)")); @@ -201,7 +201,7 @@ QStringLiteral("ContactAddedToPerson")); message.setArguments(QVariantList() << id << personUriString); - + pendingMessages << message; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/personpluginmanager.cpp new/kpeople-5.51.0/src/personpluginmanager.cpp --- old/kpeople-5.50.0/src/personpluginmanager.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/personpluginmanager.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -16,7 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "personpluginmanager_p.h" +#include "personpluginmanager.h" #include "backends/basepersonsdatasource.h" #include <KPluginMetaData> @@ -26,7 +26,8 @@ #include <KService> #include <QMutex> -#include <QDebug> +#include <QMutexLocker> +#include "kpeople_debug.h" using namespace KPeople; @@ -39,6 +40,7 @@ QHash<QString /* SourceName*/, BasePersonsDataSource *> dataSourcePlugins; void loadDataSourcePlugins(); + bool m_autoloadDataSourcePlugins; bool m_loadedDataSourcePlugins; QMutex m_mutex; @@ -46,8 +48,9 @@ Q_GLOBAL_STATIC(PersonPluginManagerPrivate, s_instance) -PersonPluginManagerPrivate::PersonPluginManagerPrivate(): - m_loadedDataSourcePlugins(false) +PersonPluginManagerPrivate::PersonPluginManagerPrivate() + : m_autoloadDataSourcePlugins(true) + , m_loadedDataSourcePlugins(false) { } @@ -62,11 +65,17 @@ Q_FOREACH (const KPluginMetaData &service, pluginList) { KPluginLoader loader(service.fileName()); KPluginFactory *factory = loader.factory(); - BasePersonsDataSource *dataSource = qobject_cast<BasePersonsDataSource*>(factory->create()); + BasePersonsDataSource *dataSource = factory->create<BasePersonsDataSource>(); if (dataSource) { - dataSourcePlugins[dataSource->sourcePluginId()] = dataSource; + const QString pluginId = dataSource->sourcePluginId(); + if (!dataSourcePlugins.contains(pluginId)) { + dataSourcePlugins[pluginId] = dataSource; + } else { + dataSource->deleteLater(); + qCDebug(KPEOPLE_LOG) << "Plugin" << pluginId << "was already loaded manually, ignoring..."; + } } else { - qWarning() << "Failed to create data source " << service.name() << service.fileName(); + qCWarning(KPEOPLE_LOG) << "Failed to create data source " << service.name() << service.fileName(); } } @@ -79,39 +88,50 @@ if (dataSource) { dataSourcePlugins[dataSource->sourcePluginId()] = dataSource; } else { - qWarning() << "Failed to create data source " << service->name() << service->path(); + qCWarning(KPEOPLE_LOG) << "Failed to create data source " << service->name() << service->path(); } } m_loadedDataSourcePlugins = true; } +void PersonPluginManager::setAutoloadDataSourcePlugins(bool autoloadDataSourcePlugins) +{ + s_instance->m_autoloadDataSourcePlugins = autoloadDataSourcePlugins; +} + +void PersonPluginManager::addDataSource(const QString &sourceId, BasePersonsDataSource *source) +{ + QMutexLocker(&s_instance->m_mutex); + if (s_instance->dataSourcePlugins.contains(sourceId)) { + qCWarning(KPEOPLE_LOG) << "Attempting to load data source that is already loaded, overriding!"; + s_instance->dataSourcePlugins[sourceId]->deleteLater(); + } + s_instance->dataSourcePlugins.insert(sourceId, source); +} + void PersonPluginManager::setDataSourcePlugins(const QHash<QString, BasePersonsDataSource * > &dataSources) { - s_instance->m_mutex.lock(); + QMutexLocker(&s_instance->m_mutex); qDeleteAll(s_instance->dataSourcePlugins); s_instance->dataSourcePlugins = dataSources; s_instance->m_loadedDataSourcePlugins = true; - s_instance->m_mutex.unlock(); } QList<BasePersonsDataSource *> PersonPluginManager::dataSourcePlugins() { - s_instance->m_mutex.lock(); - if (!s_instance->m_loadedDataSourcePlugins) { + QMutexLocker(&s_instance->m_mutex); + if (!s_instance->m_loadedDataSourcePlugins && s_instance->m_autoloadDataSourcePlugins) { s_instance->loadDataSourcePlugins(); } - s_instance->m_mutex.unlock(); return s_instance->dataSourcePlugins.values(); } BasePersonsDataSource *PersonPluginManager::dataSource(const QString &sourceId) { - s_instance->m_mutex.lock(); - if (!s_instance->m_loadedDataSourcePlugins) { + QMutexLocker(&s_instance->m_mutex); + if (!s_instance->m_loadedDataSourcePlugins && s_instance->m_autoloadDataSourcePlugins) { s_instance->loadDataSourcePlugins(); } - s_instance->m_mutex.unlock(); - return s_instance->dataSourcePlugins.value(sourceId); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/personpluginmanager.h new/kpeople-5.51.0/src/personpluginmanager.h --- old/kpeople-5.50.0/src/personpluginmanager.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kpeople-5.51.0/src/personpluginmanager.h 2018-10-08 10:19:40.000000000 +0200 @@ -0,0 +1,75 @@ +/* + Copyright (C) 2013 David Edmundson <[email protected]> + Copyright (C) 2018 Igor Poboiko <[email protected]> + + 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 PERSON_PLUGIN_MANAGER_H +#define PERSON_PLUGIN_MANAGER_H + +#include <QObject> + +#include <kpeople/kpeople_export.h> + +#include <QHash> + +namespace KPeople +{ + +class AbstractPersonAction; +class BasePersonsDataSource; + +/** + This class allows applications to manage DataSource plugins + + It can be useful if an application wants to use custom DataSource, + without exposing it to other KPeople-based applications + (i.e. without installing a system-wide plugin) + + Another use-case is that it allows to pass custom arguments to DataSources + (i.e. an ItemModel which will be used as a source of data) + + @since 5.51 + */ +class KPEOPLE_EXPORT PersonPluginManager +{ +public: + /** + * Use this if you explicitly don't want KPeople to autoload all the + * available data source plugins via KPluginLoader. + * + * The default behavior is to autoload them + */ + static void setAutoloadDataSourcePlugins(bool autoloadDataSourcePlugins); + static QList<BasePersonsDataSource *> dataSourcePlugins(); + /** + * Adds custom data source. If DataSource with such @p sourceId was already loaded, we override it + * + * Takes ownership of the @p source + */ + static void addDataSource(const QString &sourceId, BasePersonsDataSource *source); + static BasePersonsDataSource *dataSource(const QString &sourceId); + static QList<AbstractPersonAction *> actions(); + + /** + * Instead of loading datasources from plugins, set sources manually + * This is for unit tests only + */ + static void setDataSourcePlugins(const QHash<QString, BasePersonsDataSource *> &dataSources); +}; +} + +#endif // PERSON_PLUGIN_MANAGER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/personpluginmanager_p.h new/kpeople-5.51.0/src/personpluginmanager_p.h --- old/kpeople-5.50.0/src/personpluginmanager_p.h 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/personpluginmanager_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -/* - Copyright (C) 2013 David Edmundson <[email protected]> - - 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 PERSON_PLUGIN_MANAGER_H -#define PERSON_PLUGIN_MANAGER_H - -#include <QObject> - -#include <kpeople/kpeople_export.h> - -#include <QHash> - -namespace KPeople -{ - -class AbstractPersonAction; -class BasePersonsDataSource; - -class KPEOPLE_EXPORT PersonPluginManager -{ -public: - static QList<BasePersonsDataSource *> dataSourcePlugins(); - static BasePersonsDataSource *dataSource(const QString &sourceId); - static QList<AbstractPersonAction *> actions(); - - /** - * Instead of loading datasources from plugins, set sources manually - * This is for unit tests only - */ - static void setDataSourcePlugins(const QHash<QString, BasePersonsDataSource *> &dataSources); -}; -} - -#endif // PERSON_PLUGIN_MANAGER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/personsmodel.cpp new/kpeople-5.51.0/src/personsmodel.cpp --- old/kpeople-5.50.0/src/personsmodel.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/personsmodel.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -21,7 +21,7 @@ #include "personsmodel.h" -#include "personpluginmanager_p.h" +#include "personpluginmanager.h" #include "metacontact_p.h" #include "backends/basepersonsdatasource.h" #include "personmanager_p.h" @@ -31,7 +31,7 @@ #include <QPixmap> #include <QTimer> #include <QUrl> -#include <QDebug> +#include "kpeople_debug.h" namespace KPeople { @@ -306,7 +306,7 @@ //if the MC object already contains this object, we want to update the row, not do an insert if (mc.contactUris().contains(contactUri)) { - qWarning() << "Source emitted contactAdded for a contact we already know about " << contactUri; + qCWarning(KPEOPLE_LOG) << "Source emitted contactAdded for a contact we already know about " << contactUri; onContactChanged(contactUri, contact); } else { int newContactPos = mc.contacts().size(); @@ -352,8 +352,9 @@ //if MC object is now invalid remove the person from the list if (!mc.isValid()) { removePerson(personUri); + } else { + personChanged(personUri); } - personChanged(personUri); } void PersonsModelPrivate::onAddContactToPerson(const QString &contactUri, const QString &newPersonUri) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/personssortfilterproxymodel.h new/kpeople-5.51.0/src/personssortfilterproxymodel.h --- old/kpeople-5.50.0/src/personssortfilterproxymodel.h 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/personssortfilterproxymodel.h 2018-10-08 10:19:40.000000000 +0200 @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PERSONSSORTFILTERMODEL_H -#define PERSONSSORTFILTERMODEL_H +#ifndef PERSONSSORTFILTERPROXYMODEL_H +#define PERSONSSORTFILTERPROXYMODEL_H #include <QScopedPointer> #include <QSortFilterProxyModel> @@ -60,4 +60,4 @@ } -#endif // PERSONSSORTFILTERMODEL_H +#endif // PERSONSSORTFILTERPROXYMODEL_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/plugins/akonadi/CMakeLists.txt new/kpeople-5.51.0/src/plugins/akonadi/CMakeLists.txt --- old/kpeople-5.50.0/src/plugins/akonadi/CMakeLists.txt 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/plugins/akonadi/CMakeLists.txt 2018-10-08 10:19:40.000000000 +0200 @@ -1,4 +1,6 @@ -add_library(akonadi_kpeople_plugin MODULE akonadidatasource.cpp) +ecm_qt_declare_logging_category(KF5People_akonadi_debug_SRCS HEADER kpeople_akonadi_plugin_debug.h IDENTIFIER KPEOPLE_AKONADI_PLUGIN_LOG CATEGORY_NAME kf5.kpeople.plugin.akonadi) + +add_library(akonadi_kpeople_plugin MODULE akonadidatasource.cpp ${KF5People_akonadi_debug_SRCS}) target_link_libraries (akonadi_kpeople_plugin ${KDEPIMLIBS_AKONADI_LIBS} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/plugins/akonadi/akonadidatasource.cpp new/kpeople-5.51.0/src/plugins/akonadi/akonadidatasource.cpp --- old/kpeople-5.50.0/src/plugins/akonadi/akonadidatasource.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/plugins/akonadi/akonadidatasource.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -29,7 +29,7 @@ #include <KPluginFactory> #include <KPluginLoader> -#include <QDebug> +#include "kpeople_akonadi_plugin_debug.h" using namespace Akonadi; @@ -128,7 +128,7 @@ void AkonadiAllContacts::onItemsFetched(KJob *job) { if (job->error()) { - kWarning() << job->errorString(); + qCWarning(KPEOPLE_AKONADI_PLUGIN_LOG) << job->errorString(); m_fetchError = true; } else { ItemFetchJob *itemFetchJob = qobject_cast<ItemFetchJob *>(job); @@ -145,7 +145,7 @@ void AkonadiAllContacts::onCollectionsFetched(KJob *job) { if (job->error()) { - kWarning() << job->errorString(); + qCWarning(KPEOPLE_AKONADI_PLUGIN_LOG) << job->errorString(); emitInitialFetchComplete(false); } else { CollectionFetchJob *fetchJob = qobject_cast<CollectionFetchJob *>(job); @@ -178,8 +178,8 @@ //if we're broken tell kpeople we've loaded so kpeople doesn't block if (state == Akonadi::ServerManager::Broken && !isInitialFetchComplete()) { emitInitialFetchComplete(false); - qWarning() << "Akonadi failed to load, some metacontact features may not be available"; - qWarning() << "For more information please load akonadi_console" ; + qCWarning(KPEOPLE_AKONADI_PLUGIN_LOG) << "Akonadi failed to load, some metacontact features may not be available"; + qCWarning(KPEOPLE_AKONADI_PLUGIN_LOG) << "For more information please load akonadi_console" ; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/CMakeLists.txt new/kpeople-5.51.0/src/widgets/CMakeLists.txt --- old/kpeople-5.50.0/src/widgets/CMakeLists.txt 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/CMakeLists.txt 2018-10-08 10:19:40.000000000 +0200 @@ -11,6 +11,8 @@ mergedelegate.cpp ) +ecm_qt_declare_logging_category(kpeople_widgets_SRCS HEADER kpeople_widgets_debug.h IDENTIFIER KPEOPLE_WIDGETS_LOG CATEGORY_NAME kf5.kpeople.widgets) + qt5_wrap_ui (kpeople_widgets_SRCS person-details-presentation.ui) add_library (KF5PeopleWidgets SHARED ${kpeople_widgets_SRCS} ) @@ -43,12 +45,6 @@ ${INSTALL_TARGETS_DEFAULT_ARGS} ) -install (FILES - - DESTINATION ${INCLUDE_INSTALL_DIR}/kpeople/widgets - COMPONENT Devel -) - ecm_generate_headers(KPeopleWidgets_CamelCase_HEADERS HEADER_NAMES AbstractFieldWidgetFactory @@ -57,7 +53,7 @@ PersonDetailsDialog Actions REQUIRED_HEADERS KPeopleWidgets_HEADERS - PREFIX KPeople + PREFIX KPeople/Widgets ) install (FILES ${KPeopleWidgets_CamelCase_HEADERS} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/actions.cpp new/kpeople-5.51.0/src/widgets/actions.cpp --- old/kpeople-5.50.0/src/widgets/actions.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/actions.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -18,7 +18,7 @@ #include "actions.h" #include <QAction> -#include <QDebug> +#include "kpeople_widgets_debug.h" #include <KPluginLoader> #include <KPluginFactory> #include <KPluginMetaData> @@ -37,12 +37,12 @@ KPluginLoader loader(service.fileName()); KPluginFactory *factory = loader.factory(); if (!factory) { - qWarning() << "Couldn't create the factory for" << service.name() << "at" << service.fileName(); + qCWarning(KPEOPLE_WIDGETS_LOG) << "Couldn't create the factory for" << service.name() << "at" << service.fileName(); continue; } AbstractPersonAction *plugin = factory->create<AbstractPersonAction>(); if (plugin) { -// qDebug() << "found plugin" << service->name(); +// qCDebug(KPEOPLE_WIDGETS_LOG) << "found plugin" << service->name(); actionPlugins << plugin; } } @@ -54,7 +54,7 @@ if (plugin) { -// qDebug() << "found plugin" << service->name(); +// qCDebug(KPEOPLE_WIDGETS_LOG) << "found plugin" << service->name(); actionPlugins << plugin; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/actions.h new/kpeople-5.51.0/src/widgets/actions.h --- old/kpeople-5.50.0/src/widgets/actions.h 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/actions.h 2018-10-08 10:19:40.000000000 +0200 @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef KPEOPLEWIDGETS_GLOBAL_H -#define KPEOPLEWIDGETS_GLOBAL_H +#ifndef KPEOPLEWIDGETS_ACTIONS_H +#define KPEOPLEWIDGETS_ACTIONS_H #include <QList> #include <kpeople/widgets/kpeoplewidgets_export.h> @@ -51,4 +51,4 @@ KPEOPLEWIDGETS_EXPORT QList<QAction *> actionsForPerson(const QString &contactUri, QObject *parent); } -#endif // KPEOPLEWIDGETS_GLOBAL_H +#endif // KPEOPLEWIDGETS_ACTIONS_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/mergedelegate.cpp new/kpeople-5.51.0/src/widgets/mergedelegate.cpp --- old/kpeople-5.50.0/src/widgets/mergedelegate.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/mergedelegate.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -31,7 +31,7 @@ #include <QLabel> #include <QCheckBox> #include <QItemSelection> -#include <QDebug> +#include "kpeople_widgets_debug.h" #include <QIcon> #include <KLocalizedString> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/mergedialog.cpp new/kpeople-5.51.0/src/widgets/mergedialog.cpp --- old/kpeople-5.50.0/src/widgets/mergedialog.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/mergedialog.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -30,7 +30,7 @@ #include <QPushButton> #include <QDialogButtonBox> #include <QListView> -#include <QDebug> +#include "kpeople_widgets_debug.h" #include <QStandardItemModel> #include <KLocalizedString> @@ -108,7 +108,7 @@ { Q_D(MergeDialog); if (!d->personsModel || !d->personsModel->rowCount() || d->duplicatesFinder) { - qWarning() << "MergeDialog failed to launch the duplicates research"; + qCWarning(KPEOPLE_WIDGETS_LOG) << "MergeDialog failed to launch the duplicates research"; return; } d->duplicatesFinder = new DuplicatesFinder(d->personsModel); @@ -221,7 +221,7 @@ } else if (deco.type() == (QVariant::Image)) { icon = QIcon(QPixmap::fromImage(deco.value<QImage>())); } else { - qWarning() << "unknown decoration type" << deco.typeName(); + qCWarning(KPEOPLE_WIDGETS_LOG) << "unknown decoration type" << deco.typeName(); } item->setIcon(icon); return item; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/persondetailsview.cpp new/kpeople-5.51.0/src/widgets/persondetailsview.cpp --- old/kpeople-5.50.0/src/widgets/persondetailsview.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/persondetailsview.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -22,7 +22,7 @@ #include <QFormLayout> #include <QLabel> #include <QVBoxLayout> -#include <QDebug> +#include "kpeople_widgets_debug.h" #include <QList> #include <QStandardPaths> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/plugins/mergecontactswidget.cpp new/kpeople-5.51.0/src/widgets/plugins/mergecontactswidget.cpp --- old/kpeople-5.50.0/src/widgets/plugins/mergecontactswidget.cpp 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/plugins/mergecontactswidget.cpp 2018-10-08 10:19:40.000000000 +0200 @@ -29,7 +29,7 @@ #include <KLocalizedString> #include <KJob> -#include <KDebug> +#include "kpeople_debug.h" #include <KPluginFactory> K_PLUGIN_FACTORY(MergeContactsWidgetFactory, registerPlugin<MergeContactsWidget>();) @@ -92,7 +92,7 @@ // building personPresentationWidget to fill up the list Q_FOREACH (const QPersistentModelIndex &duplicate, duplicates) { // displaying contact in a user friendly way - kDebug() << "Name retireved form the duplicate :" << duplicate.data(Qt::DisplayRole).toString(); + qCDebug(KPEOPLE_LOG) << "Name retireved form the duplicate :" << duplicate.data(Qt::DisplayRole).toString(); QIcon avatar ; QString name = duplicate.data(Qt::DisplayRole).toString(); @@ -131,7 +131,7 @@ duplicateMatching.append(match.indexA); } } - kDebug() << "Result of the duplicates Buster :" << duplicateMatching.size(); + qCDebug(KPEOPLE_LOG) << "Result of the duplicates Buster :" << duplicateMatching.size(); return duplicateMatching; } @@ -139,7 +139,7 @@ { m_mergeButton->setVisible(false); if (m_duplicatesBuster || !m_person || !m_person->isValid() || !m_model) { - kDebug() << "Merge Widget failed to launch the duplicates search"; + qCDebug(KPEOPLE_LOG) << "Merge Widget failed to launch the duplicates search"; return; } m_duplicatesBuster = new DuplicatesFinder(m_model , this); @@ -187,6 +187,6 @@ indexesToMerge.append(mergeContact.first); } } - kDebug() << "Amount of checked box enable :" << indexesToMerge.size(); + qCDebug(KPEOPLE_LOG) << "Amount of checked box enable :" << indexesToMerge.size(); return indexesToMerge; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpeople-5.50.0/src/widgets/plugins/mergecontactswidget.h new/kpeople-5.51.0/src/widgets/plugins/mergecontactswidget.h --- old/kpeople-5.50.0/src/widgets/plugins/mergecontactswidget.h 2018-09-02 21:30:34.000000000 +0200 +++ new/kpeople-5.51.0/src/widgets/plugins/mergecontactswidget.h 2018-10-08 10:19:40.000000000 +0200 @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef MERGE_CONTACT_WIDGET_H -#define MERGE_CONTACT_WIDGET_H +#ifndef MERGE_CONTACTS_WIDGET_H +#define MERGE_CONTACTS_WIDGET_H #include "abstractpersondetailswidget.h" @@ -59,4 +59,4 @@ QList< QPair<QPersistentModelIndex, PersonPresentationWidget *> > m_listMergeContacts; }; -#endif // MERGE_CONTACT_WIDGET_H +#endif // MERGE_CONTACTS_WIDGET_H
