Hello community, here is the log from the commit of package akonadi-search for openSUSE:Factory checked in at 2017-05-08 18:45:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/akonadi-search (Old) and /work/SRC/openSUSE:Factory/.akonadi-search.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "akonadi-search" Mon May 8 18:45:29 2017 rev:21 rq:490332 version:17.04.0 Changes: -------- --- /work/SRC/openSUSE:Factory/akonadi-search/akonadi-search.changes 2017-03-15 00:50:16.302882685 +0100 +++ /work/SRC/openSUSE:Factory/.akonadi-search.new/akonadi-search.changes 2017-05-08 18:45:32.392275695 +0200 @@ -1,0 +2,49 @@ +Mon Apr 24 07:31:55 UTC 2017 - klaas.freitag@suse.com + +- Added patch file name to changes file to survive automatic tests + +------------------------------------------------------------------- +Fri Apr 21 08:43:42 UTC 2017 - klaas.freitag@suse.com + +- Added patch documentation to spec file. + +------------------------------------------------------------------- +Wed Apr 19 10:56:34 UTC 2017 - klaas.freitag@suse.com + +- Add a patch fix_uid_search.patch to fix contact indexing and searching in Akonadi. + Upstream patch commit: + https://cgit.kde.org/akonadi-search.git/commit/?id=abc806bdc1859c2b840efd194... + Can be removed with the next version of Akonadi again. + +------------------------------------------------------------------- +Sun Apr 16 10:44:42 CEST 2017 - lbeltrame@kde.org + +- Update to 17.04.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-17.04.0.php +- Changes since 17.03.90: + * Don't get hit forever by an old setting from baloorc when hand-editing the agent rc file. + * Add signal collectionIndexingFinished so we know that collection was + +------------------------------------------------------------------- +Wed Apr 12 20:25:09 CEST 2017 - lbeltrame@kde.org + +- Update to 17.03.90 + * New bugfix release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-17.04-rc.php +- Changes since 17.03.80: + * Fix Bug 377983 - Getting a lot of indexer syslog messages + +------------------------------------------------------------------- +Sat Mar 25 23:10:05 CET 2017 - lbeltrame@kde.org + +- Update to 17.03.80 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-17.03.80.php +- Changes since 16.12.3: + * Too many changes to list here + +------------------------------------------------------------------- Old: ---- akonadi-search-16.12.3.tar.xz New: ---- akonadi-search-17.04.0.tar.xz fix_uid_search.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ akonadi-search.spec ++++++ --- /var/tmp/diff_new_pack.7bY9Gh/_old 2017-05-08 18:45:36.147744639 +0200 +++ /var/tmp/diff_new_pack.7bY9Gh/_new 2017-05-08 18:45:36.147744639 +0200 @@ -16,17 +16,21 @@ # +%bcond_without lang + Name: akonadi-search -Version: 16.12.3 +Version: 17.04.0 Release: 0 %define kf5_version 5.26.0 -# Latest stable Applications (e.g. 16.08 in KA, but 16.12.3 in KUA) +# Latest stable Applications (e.g. 16.08 in KA, but 16.11.80 in KUA) %{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} Summary: Framework for searching and managing PIM metadata License: GPL-2.0+ and LGPL-2.1+ and LGPL-3.0 Group: System/GUI/KDE Url: http://www.kde.org Source0: %{name}-%{version}.tar.xz +#PATCH-FIX-UPSTREAM fix_uid_search.patch freitag@opensuse.org -- fix for indexing and searching of contacts. +Patch0: fix_uid_search.patch BuildRequires: akonadi-mime-devel >= %{_kapp_version} BuildRequires: akonadi-server-devel >= %{_kapp_version} BuildRequires: extra-cmake-modules >= 5.17.0 @@ -42,7 +46,13 @@ BuildRequires: libxapian-devel BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Test) +%if 0%{?suse_version} > 1325 +BuildRequires: libboost_headers-devel +%else +BuildRequires: boost-devel +%endif Obsoletes: baloo-pim < %{version} +Recommends: %{name}-lang BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -72,8 +82,13 @@ Baloo is a framework for searching and managing metadata. This package contains aditional command line utilities. Development files. +%if %{with lang} +%lang_package +%endif + %prep %setup -q +%patch0 -p1 %build %cmake_kf5 -d build @@ -81,6 +96,9 @@ %install %kf5_makeinstall -C build + %if %{with lang} + %find_lang %{name} --with-man --all-name + %endif %post -n libKF5AkonadiSearch -p /sbin/ldconfig %postun -n libKF5AkonadiSearch -p /sbin/ldconfig @@ -120,4 +138,9 @@ %{_kf5_libdir}/libKF5AkonadiSearchXapian.so %{_kf5_libdir}/libKF5AkonadiSearchDebug.so +%if %{with lang} +%files lang -f %{name}.lang +%doc COPYING* +%endif + %changelog ++++++ akonadi-search-16.12.3.tar.xz -> akonadi-search-17.04.0.tar.xz ++++++ ++++ 4819 lines of diff (skipped) ++++++ fix_uid_search.patch ++++++
From abc806bdc1859c2b840efd194dab4f01bc280f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?=
Date: Tue, 18 Apr 2017 22:47:38 +0200 Subject: Fix contact UID indexing and search
Index UID with a prefix so we can query by it. Makes ContactSearchJob for UID actually work. Unfortunately we need to reindex all contacts for this, and since there's no mechanism to reindex only contacts, we have to reindex everything. --- agent/agent.cpp | 2 +- agent/contactindexer.cpp | 2 +- akonadiplugin/autotests/searchplugintest.cpp | 20 ++++++++++++++++++++ lib/contactquery.cpp | 8 +++++--- search/contact/contactsearchstore.cpp | 1 + 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/agent/agent.cpp b/agent/agent.cpp index 65f0b72..55e2780 100644 --- a/agent/agent.cpp +++ b/agent/agent.cpp @@ -49,7 +49,7 @@ #include <QFile> -#define INDEXING_AGENT_VERSION 4 +#define INDEXING_AGENT_VERSION 5 AkonadiIndexingAgent::AkonadiIndexingAgent(const QString &id) : AgentBase(id), diff --git a/agent/contactindexer.cpp b/agent/contactindexer.cpp index 7c0424e..e490254 100644 --- a/agent/contactindexer.cpp +++ b/agent/contactindexer.cpp @@ -83,7 +83,7 @@ bool ContactIndexer::indexContact(const Akonadi::Item &item) doc.indexText(name); doc.indexText(addresse.nickName()); - doc.indexText(addresse.uid()); + doc.indexText(addresse.uid(), QStringLiteral("UID")); doc.indexText(name, QStringLiteral("NA")); doc.indexText(addresse.nickName(), QStringLiteral("NI")); diff --git a/akonadiplugin/autotests/searchplugintest.cpp b/akonadiplugin/autotests/searchplugintest.cpp index 3945ef9..27a5946 100644 --- a/akonadiplugin/autotests/searchplugintest.cpp +++ b/akonadiplugin/autotests/searchplugintest.cpp @@ -301,6 +301,18 @@ private Q_SLOTS: contactIndexer.index(item); } { + KContacts::Addressee addressee; + addressee.setUid(QStringLiteral("abcd-efgh-1234-5678")); + addressee.setName(QStringLiteral("Dan Vrátil")); + addressee.setEmails({ QStringLiteral("dan@test.com") }); + addressee.setBirthday(QDateTime(QDate(2001, 01, 01))); + Akonadi::Item item(KContacts::Addressee::mimeType()); + item.setId(105); + item.setPayload(addressee); + item.setParentCollection(Akonadi::Collection(3)); + contactIndexer.index(item); + } + { KContacts::ContactGroup group; group.setName(QStringLiteral("group1")); Akonadi::Item item(KContacts::ContactGroup::mimeType()); @@ -621,6 +633,14 @@ private Q_SLOTS: } { Akonadi::SearchQuery query; + query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Uid, QStringLiteral("abcd-efgh-1234-5678"), Akonadi::SearchTerm::CondEqual)); + + QVector<qint64> collections = { 3 }; + QSet<qint64> result = { 105 }; + QTest::newRow("contact by uid 2") << QString::fromLatin1(query.toJSON()) << collections << contactMimeTypes << result; + } + { + Akonadi::SearchQuery query; query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Email, QStringLiteral("JANE@TEST.COM"), Akonadi::SearchTerm::CondEqual)); QVector<qint64> collections = QVector<qint64>() << 3; diff --git a/lib/contactquery.cpp b/lib/contactquery.cpp index d7a3fc0..a833b49 100644 --- a/lib/contactquery.cpp +++ b/lib/contactquery.cpp @@ -150,7 +150,8 @@ ResultIterator ContactQuery::exec() } if (!d->uid.isEmpty()) { - m_queries << Xapian::Query(d->uid.toStdString()); + const QByteArray ba = "UID" + d->uid.toUtf8(); + m_queries << Xapian::Query(ba.constData()); } } else if (d->criteria == StartsWithMatch) { if (!d->any.isEmpty()) { @@ -187,8 +188,9 @@ ResultIterator ContactQuery::exec() if (!d->uid.isEmpty()) { Xapian::QueryParser parser; parser.set_database(db); - - m_queries << parser.parse_query(d->uid.toStdString(), Xapian::QueryParser::FLAG_PARTIAL); + parser.add_prefix("", "UID"); + const QByteArray ba = d->uid.toUtf8(); + m_queries << parser.parse_query(ba.constData(), Xapian::QueryParser::FLAG_PARTIAL); } } try { diff --git a/search/contact/contactsearchstore.cpp b/search/contact/contactsearchstore.cpp index 5b4f313..5d36beb 100644 --- a/search/contact/contactsearchstore.cpp +++ b/search/contact/contactsearchstore.cpp @@ -31,6 +31,7 @@ ContactSearchStore::ContactSearchStore(QObject *parent) m_prefix.insert(QStringLiteral("nick"), QStringLiteral("NI")); m_prefix.insert(QStringLiteral("email"), QStringLiteral("")); // Email currently doesn't map to anything m_prefix.insert(QStringLiteral("collection"), QStringLiteral("C")); + m_prefix.insert(QStringLiteral("uid"), QStringLiteral("UID")); m_valueProperties.insert(QStringLiteral("birthday"), 0); m_valueProperties.insert(QStringLiteral("anniversary"), 1); -- cgit v0.11.2