Hello community, here is the log from the commit of package akonadi-server for openSUSE:Factory checked in at 2019-02-14 14:13:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/akonadi-server (Old) and /work/SRC/openSUSE:Factory/.akonadi-server.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "akonadi-server" Thu Feb 14 14:13:54 2019 rev:53 rq:673678 version:18.12.2 Changes: -------- --- /work/SRC/openSUSE:Factory/akonadi-server/akonadi-server.changes 2019-01-21 10:10:06.522694074 +0100 +++ /work/SRC/openSUSE:Factory/.akonadi-server.new.28833/akonadi-server.changes 2019-02-14 14:13:58.588203202 +0100 @@ -1,0 +2,17 @@ +Sat Feb 09 08:24:47 UTC 2019 - lbeltr...@kde.org + +- Update to 18.12.2 + * New bugfix release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-18.12.2.php +- Changes since 18.12.1: + * Fix aggregation logic for cacheOnly and ignoreErrors. + * autotests: rename notificationmanagertest to notificationsubscribertest + * Extend tagtest with more checks that the full tag information is sent. + * autotests: remove QEXPECT_FAIL, the mysql bug got fixed. + * Fix tag name/type/gid missing in notifications about tags. + * Minor: improve QDebug output for Akonadi::Tag + * actually look for mysql binaries in PATH + * Allow to exclude unified mailbox from local subscription + +------------------------------------------------------------------- Old: ---- akonadi-18.12.1.tar.xz New: ---- akonadi-18.12.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ akonadi-server.spec ++++++ --- /var/tmp/diff_new_pack.YQAKGj/_old 2019-02-14 14:13:59.104202948 +0100 +++ /var/tmp/diff_new_pack.YQAKGj/_new 2019-02-14 14:13:59.108202946 +0100 @@ -22,7 +22,7 @@ %{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} %bcond_without lang Name: akonadi-server -Version: 18.12.1 +Version: 18.12.2 Release: 0 Summary: PIM Storage Service License: LGPL-2.1-or-later ++++++ akonadi-18.12.1.tar.xz -> akonadi-18.12.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/CMakeLists.txt new/akonadi-18.12.2/CMakeLists.txt --- old/akonadi-18.12.1/CMakeLists.txt 2019-01-08 01:17:35.000000000 +0100 +++ new/akonadi-18.12.2/CMakeLists.txt 2019-02-05 01:44:33.000000000 +0100 @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) -set(PIM_VERSION "5.10.1") +set(PIM_VERSION "5.10.2") project(Akonadi VERSION ${PIM_VERSION}) set(CMAKE_CXX_STANDARD 14) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/autotests/libs/autoincrementtest.cpp new/akonadi-18.12.2/autotests/libs/autoincrementtest.cpp --- old/akonadi-18.12.1/autotests/libs/autoincrementtest.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/autotests/libs/autoincrementtest.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -34,11 +34,6 @@ QTEST_AKONADIMAIN(AutoIncrementTest) -static bool isMySQLEnvironment() -{ - return (qgetenv("TESTRUNNER_DB_ENVIRONMENT") == "mysql"); -} - void AutoIncrementTest::initTestCase() { AkonadiTest::checkTestIsIsolated(); @@ -97,10 +92,6 @@ AKVERIFYEXEC(job); Item newItem = job->item(); - if (isMySQLEnvironment()) { - QEXPECT_FAIL("", "Server bug: http://bugs.mysql.com/bug.php?id=199", Continue); - } - QVERIFY(newItem.id() > lastId); lastId = newItem.id(); } @@ -134,10 +125,6 @@ AKVERIFYEXEC(job); Collection newCollection = job->collection(); - if (isMySQLEnvironment()) { - QEXPECT_FAIL("", "Server bug: http://bugs.mysql.com/bug.php?id=199", Continue); - } - QVERIFY(newCollection.id() > lastId); lastId = newCollection.id(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/autotests/libs/tagtest.cpp new/akonadi-18.12.2/autotests/libs/tagtest.cpp --- old/akonadi-18.12.1/autotests/libs/tagtest.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/autotests/libs/tagtest.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -756,23 +756,34 @@ TagCreateJob *createjob = new TagCreateJob(tag, this); AKVERIFYEXEC(createjob); createdTag = createjob->tag(); + QCOMPARE(createdTag.type(), tag.type()); + QCOMPARE(createdTag.name(), tag.name()); + QCOMPARE(createdTag.gid(), tag.gid()); //We usually pick up signals from the previous tests as well (due to server-side notification caching) QTRY_VERIFY(addedSpy.count() >= 1); QTRY_COMPARE(addedSpy.last().first().value<Akonadi::Tag>().id(), createdTag.id()); - QVERIFY(addedSpy.last().first().value<Akonadi::Tag>().hasAttribute<Akonadi::TagAttribute>()); + const Akonadi::Tag notifiedTag = addedSpy.last().first().value<Akonadi::Tag>(); + QCOMPARE(notifiedTag.type(), createdTag.type()); + QCOMPARE(notifiedTag.gid(), createdTag.gid()); + QVERIFY(notifiedTag.hasAttribute<Akonadi::TagAttribute>()); + QCOMPARE(notifiedTag.name(), createdTag.name()); // requires the TagAttribute } { - QSignalSpy modifedSpy(&monitor, SIGNAL(tagChanged(Akonadi::Tag))); - QVERIFY(modifedSpy.isValid()); + QSignalSpy modifiedSpy(&monitor, SIGNAL(tagChanged(Akonadi::Tag))); + QVERIFY(modifiedSpy.isValid()); createdTag.setName(QStringLiteral("name3")); TagModifyJob *modJob = new TagModifyJob(createdTag, this); AKVERIFYEXEC(modJob); //We usually pick up signals from the previous tests as well (due to server-side notification caching) - QTRY_VERIFY(modifedSpy.count() >= 1); - QTRY_COMPARE(modifedSpy.last().first().value<Akonadi::Tag>().id(), createdTag.id()); - QVERIFY(modifedSpy.last().first().value<Akonadi::Tag>().hasAttribute<Akonadi::TagAttribute>()); + QTRY_VERIFY(modifiedSpy.count() >= 1); + QTRY_COMPARE(modifiedSpy.last().first().value<Akonadi::Tag>().id(), createdTag.id()); + const Akonadi::Tag notifiedTag = modifiedSpy.last().first().value<Akonadi::Tag>(); + QCOMPARE(notifiedTag.type(), createdTag.type()); + QCOMPARE(notifiedTag.gid(), createdTag.gid()); + QVERIFY(notifiedTag.hasAttribute<Akonadi::TagAttribute>()); + QCOMPARE(notifiedTag.name(), createdTag.name()); // requires the TagAttribute } { @@ -782,6 +793,11 @@ AKVERIFYEXEC(deletejob); QTRY_VERIFY(removedSpy.count() >= 1); QTRY_COMPARE(removedSpy.last().first().value<Akonadi::Tag>().id(), createdTag.id()); + const Akonadi::Tag notifiedTag = removedSpy.last().first().value<Akonadi::Tag>(); + QCOMPARE(notifiedTag.type(), createdTag.type()); + QCOMPARE(notifiedTag.gid(), createdTag.gid()); + QVERIFY(notifiedTag.hasAttribute<Akonadi::TagAttribute>()); + QCOMPARE(notifiedTag.name(), createdTag.name()); // requires the TagAttribute } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/autotests/server/CMakeLists.txt new/akonadi-18.12.2/autotests/server/CMakeLists.txt --- old/akonadi-18.12.1/autotests/server/CMakeLists.txt 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/autotests/server/CMakeLists.txt 2019-02-02 18:10:04.000000000 +0100 @@ -84,9 +84,10 @@ add_server_test(dbconfigtest.cpp) add_server_test(parthelpertest.cpp) add_server_test(itemretrievertest.cpp) -add_server_test(notificationmanagertest.cpp) +add_server_test(notificationsubscribertest.cpp) add_server_test(parttypehelpertest.cpp) add_server_test(collectionstatisticstest.cpp) +add_server_test(aggregatedfetchscopetest.cpp) if (SQLITE_FOUND) # tests using the fake server need the QSQLITE3 plugin add_server_test(partstreamertest.cpp) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/autotests/server/aggregatedfetchscopetest.cpp new/akonadi-18.12.2/autotests/server/aggregatedfetchscopetest.cpp --- old/akonadi-18.12.1/autotests/server/aggregatedfetchscopetest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/akonadi-18.12.2/autotests/server/aggregatedfetchscopetest.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -0,0 +1,163 @@ +/* + Copyright (c) 2019 David Faure <fa...@kde.org> + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 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 Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#include <QObject> + +#include <shared/aktest.h> +#include "aggregatedfetchscope.h" + +#include <QTest> + +using namespace Akonadi; +using namespace Akonadi::Server; + +class AggregatedFetchScopeTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + + void testTagApply() + { + AggregatedTagFetchScope scope; + + // first subscriber, A + scope.addSubscriber(); + Protocol::TagFetchScope oldTagScope, tagScopeA; + QSet<QByteArray> attrs = {"FOO"}; + tagScopeA.setAttributes(attrs); + tagScopeA.setFetchIdOnly(true); + scope.apply(oldTagScope, tagScopeA); + QCOMPARE(scope.attributes(), attrs); + QVERIFY(scope.fetchIdOnly()); + + // second subscriber, B + Protocol::TagFetchScope tagScopeB = tagScopeA; + tagScopeB.setFetchIdOnly(false); + scope.addSubscriber(); + scope.apply(oldTagScope, tagScopeB); + QCOMPARE(scope.attributes(), attrs); + QVERIFY(!scope.fetchIdOnly()); + + // then B goes away + scope.apply(tagScopeB, oldTagScope); + scope.removeSubscriber(); + QCOMPARE(scope.attributes(), attrs); + QVERIFY(scope.fetchIdOnly()); + + // A goes away + scope.apply(tagScopeA, oldTagScope); + scope.removeSubscriber(); + QCOMPARE(scope.attributes(), QSet<QByteArray>()); + } + + void testCollectionApply() + { + AggregatedCollectionFetchScope scope; + + // first subscriber, A + scope.addSubscriber(); + Protocol::CollectionFetchScope oldCollectionScope, collectionScopeA; + QSet<QByteArray> attrs = {"FOO"}; + collectionScopeA.setAttributes(attrs); + collectionScopeA.setFetchIdOnly(true); + scope.apply(oldCollectionScope, collectionScopeA); + QCOMPARE(scope.attributes(), attrs); + QVERIFY(scope.fetchIdOnly()); + + // second subscriber, B + Protocol::CollectionFetchScope collectionScopeB = collectionScopeA; + collectionScopeB.setFetchIdOnly(false); + scope.addSubscriber(); + scope.apply(oldCollectionScope, collectionScopeB); + QCOMPARE(scope.attributes(), attrs); + QVERIFY(!scope.fetchIdOnly()); + + // then B goes away + scope.apply(collectionScopeB, oldCollectionScope); + scope.removeSubscriber(); + QCOMPARE(scope.attributes(), attrs); + QVERIFY(scope.fetchIdOnly()); + + // A goes away + scope.apply(collectionScopeA, oldCollectionScope); + scope.removeSubscriber(); + QCOMPARE(scope.attributes(), QSet<QByteArray>()); + } + + void testItemApply() + { + AggregatedItemFetchScope scope; + QCOMPARE(scope.ancestorDepth(), Protocol::ItemFetchScope::NoAncestor); + + // first subscriber, A + scope.addSubscriber(); + Protocol::ItemFetchScope oldItemScope, itemScopeA; + QVector<QByteArray> parts = {"FOO"}; + QSet<QByteArray> partsSet = {"FOO"}; + itemScopeA.setRequestedParts(parts); + itemScopeA.setAncestorDepth(Protocol::ItemFetchScope::ParentAncestor); + itemScopeA.setFetch(Protocol::ItemFetchScope::CacheOnly); + itemScopeA.setFetch(Protocol::ItemFetchScope::IgnoreErrors); + scope.apply(oldItemScope, itemScopeA); + QCOMPARE(scope.requestedParts(), partsSet); + QCOMPARE(scope.ancestorDepth(), Protocol::ItemFetchScope::ParentAncestor); + QVERIFY(scope.cacheOnly()); + QVERIFY(scope.ignoreErrors()); + + // second subscriber, B + Protocol::ItemFetchScope itemScopeB = itemScopeA; + itemScopeB.setAncestorDepth(Protocol::ItemFetchScope::AllAncestors); + scope.addSubscriber(); + QVERIFY(!scope.cacheOnly()); // they don't agree so: false + QVERIFY(!scope.ignoreErrors()); + scope.apply(oldItemScope, itemScopeB); + QCOMPARE(scope.requestedParts(), partsSet); + QCOMPARE(scope.ancestorDepth(), Protocol::ItemFetchScope::AllAncestors); + + // subscriber C with ParentAncestor - but that won't make change it + Protocol::ItemFetchScope itemScopeC = itemScopeA; + scope.addSubscriber(); + scope.apply(oldItemScope, itemScopeC); + QCOMPARE(scope.requestedParts(), partsSet); + QCOMPARE(scope.ancestorDepth(), Protocol::ItemFetchScope::AllAncestors); // no change + + // then C goes away + scope.apply(itemScopeC, oldItemScope); + scope.removeSubscriber(); + QCOMPARE(scope.requestedParts(), partsSet); + QCOMPARE(scope.ancestorDepth(), Protocol::ItemFetchScope::AllAncestors); + + // then B goes away + scope.apply(itemScopeB, oldItemScope); + scope.removeSubscriber(); + QCOMPARE(scope.requestedParts(), partsSet); + QCOMPARE(scope.ancestorDepth(), Protocol::ItemFetchScope::ParentAncestor); + + // A goes away + scope.apply(itemScopeA, oldItemScope); + scope.removeSubscriber(); + QCOMPARE(scope.requestedParts(), QSet<QByteArray>()); + QCOMPARE(scope.ancestorDepth(), Protocol::ItemFetchScope::NoAncestor); + } +}; + +QTEST_MAIN(AggregatedFetchScopeTest) + +#include "aggregatedfetchscopetest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/autotests/server/notificationmanagertest.cpp new/akonadi-18.12.2/autotests/server/notificationmanagertest.cpp --- old/akonadi-18.12.1/autotests/server/notificationmanagertest.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/autotests/server/notificationmanagertest.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,404 +0,0 @@ -/* - Copyright (c) 2013 Daniel Vrátil <dvra...@redhat.com> - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 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 Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include <aktest.h> - -#include "entities.h" -#include "notificationmanager.h" -#include "notificationsubscriber.h" - -#include <QObject> -#include <QTest> - -using namespace Akonadi; -using namespace Akonadi::Server; - -Q_DECLARE_METATYPE(QVector<QString>) - -class TestableNotificationSubscriber : public NotificationSubscriber -{ -public: - TestableNotificationSubscriber() - : NotificationSubscriber() - { - mSubscriber = "TestSubscriber"; - } - - void setAllMonitored(bool allMonitored) - { - mAllMonitored = allMonitored; - } - - void setMonitoredCollection(qint64 collection, bool monitored) - { - if (monitored) { - mMonitoredCollections.insert(collection); - } else { - mMonitoredCollections.remove(collection); - } - } - - void setMonitoredItem(qint64 item, bool monitored) - { - if (monitored) { - mMonitoredItems.insert(item); - } else { - mMonitoredItems.remove(item); - } - } - - void setMonitoredResource(const QByteArray &resource, bool monitored) - { - if (monitored) { - mMonitoredResources.insert(resource); - } else { - mMonitoredResources.remove(resource); - } - } - - void setMonitoredMimeType(const QString &mimeType, bool monitored) - { - if (monitored) { - mMonitoredMimeTypes.insert(mimeType); - } else { - mMonitoredMimeTypes.remove(mimeType); - } - } - - void setIgnoredSession(const QByteArray &session, bool ignored) - { - if (ignored) { - mIgnoredSessions.insert(session); - } else { - mIgnoredSessions.remove(session); - } - } - - void writeNotification(const Protocol::ChangeNotificationPtr ¬ification) override - { - emittedNotifications << notification; - } - - Protocol::ChangeNotificationList emittedNotifications; -}; - -class NotificationManagerTest : public QObject -{ - Q_OBJECT - - typedef QList<NotificationSubscriber *> NSList; - - - Protocol::FetchItemsResponse itemResponse(qint64 id, const QString &rid, const QString &rrev, const QString &mt) - { - Protocol::FetchItemsResponse item; - item.setId(id); - item.setRemoteId(rid); - item.setRemoteRevision(rrev); - item.setMimeType(mt); - return item; - } - -private Q_SLOTS: - void testSourceFilter_data() - { - qRegisterMetaType<Protocol::ChangeNotificationList>(); - - QTest::addColumn<bool>("allMonitored"); - QTest::addColumn<QVector<Entity::Id> >("monitoredCollections"); - QTest::addColumn<QVector<Entity::Id> >("monitoredItems"); - QTest::addColumn<QVector<QByteArray> >("monitoredResources"); - QTest::addColumn<QVector<QString> >("monitoredMimeTypes"); - QTest::addColumn<QVector<QByteArray> >("ignoredSessions"); - QTest::addColumn<Protocol::ChangeNotificationPtr>("notification"); - QTest::addColumn<bool>("accepted"); - -#define EmptyList(T) (QVector<T>()) -#define List(T,x) (QVector<T>() << x) - - auto itemMsg = Protocol::ItemChangeNotificationPtr::create(); - itemMsg->setOperation(Protocol::ItemChangeNotification::Add); - itemMsg->setParentCollection(1); - QTest::newRow("monitorAll vs notification without items") - << true - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << EmptyList(QString) - << EmptyList(QByteArray) - << itemMsg.staticCast<Protocol::ChangeNotification>() - << false; - - itemMsg = Protocol::ItemChangeNotificationPtr::create(*itemMsg); - itemMsg->setItems({ itemResponse(1, QString(), QString(), QStringLiteral("message/rfc822")) }); - QTest::newRow("monitorAll vs notification with one item") - << true - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << EmptyList(QString) - << EmptyList(QByteArray) - << itemMsg.staticCast<Protocol::ChangeNotification>() - << true; - - QTest::newRow("item monitored but different mimetype") - << false - << EmptyList(Entity::Id) - << List(Entity::Id, 1 << 2) - << EmptyList(QByteArray) - << List(QString, QStringLiteral("random/mimetype")) - << EmptyList(QByteArray) - << Protocol::ItemChangeNotificationPtr::create(*itemMsg).staticCast<Protocol::ChangeNotification>() - << false; - - QTest::newRow("item not monitored, but mimetype matches") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << List(QString, QStringLiteral("message/rfc822")) - << EmptyList(QByteArray) - << Protocol::ItemChangeNotificationPtr::create(*itemMsg).staticCast<Protocol::ChangeNotification>() - << true; - - itemMsg = Protocol::ItemChangeNotificationPtr::create(*itemMsg); - itemMsg->setSessionId("testSession"); - QTest::newRow("item monitored but session ignored") - << false - << EmptyList(Entity::Id) - << List(Entity::Id, 1) - << EmptyList(QByteArray) - << EmptyList(QString) - << List(QByteArray, "testSession") - << itemMsg.staticCast<Protocol::ChangeNotification>() - << false; - - // Simulate adding a new resource - auto colMsg = Protocol::CollectionChangeNotificationPtr::create(); - colMsg->setOperation(Protocol::CollectionChangeNotification::Add); - Protocol::FetchCollectionsResponse col; - col.setId(1); - col.setRemoteId(QStringLiteral("imap://user@some.domain/")); - colMsg->setCollection(std::move(col)); - colMsg->setParentCollection(0); - colMsg->setSessionId("akonadi_imap_resource_0"); - colMsg->setResource("akonadi_imap_resource_0"); - QTest::newRow("new root collection in non-monitored resource") - << false - << List(Entity::Id, 0) - << EmptyList(Entity::Id) - << List(QByteArray, "akonadi_search_resource") - << List(QString, QStringLiteral("message/rfc822")) - << EmptyList(QByteArray) - << colMsg.staticCast<Protocol::ChangeNotification>() - << true; - - itemMsg = Protocol::ItemChangeNotificationPtr::create(); - itemMsg->setOperation(Protocol::ItemChangeNotification::Move); - itemMsg->setResource("akonadi_resource_1"); - itemMsg->setDestinationResource("akonadi_resource_2"); - itemMsg->setParentCollection(1); - itemMsg->setParentDestCollection(2); - itemMsg->setSessionId("kmail"); - itemMsg->setItems({ itemResponse(10, QStringLiteral("123"), QStringLiteral("1"), QStringLiteral("message/rfc822")) }); - QTest::newRow("inter-resource move, source source") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << List(QByteArray, "akonadi_resource_1") - << List(QString, QStringLiteral("message/rfc822")) - << List(QByteArray, "akonadi_resource_1") - << itemMsg.staticCast<Protocol::ChangeNotification>() - << true; - - QTest::newRow("inter-resource move, destination source") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << List(QByteArray, "akonadi_resource_2") - << List(QString, QStringLiteral("message/rfc822")) - << List(QByteArray, "akonadi_resource_2") - << itemMsg.staticCast<Protocol::ChangeNotification>() - << true; - - QTest::newRow("inter-resource move, uninterested party") - << false - << List(Entity::Id, 12) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << List(QString, QStringLiteral("inode/directory")) - << EmptyList(QByteArray) - << itemMsg.staticCast<Protocol::ChangeNotification>() - << false; - - itemMsg = Protocol::ItemChangeNotificationPtr::create(); - itemMsg->setOperation(Protocol::ItemChangeNotification::Move); - itemMsg->setResource("akonadi_resource_0"); - itemMsg->setDestinationResource("akonadi_resource_0"); - itemMsg->setParentCollection(1); - itemMsg->setParentDestCollection(2); - itemMsg->setSessionId("kmail"); - itemMsg->setItems({ - itemResponse(10, QStringLiteral("123"), QStringLiteral("1"), QStringLiteral("message/rfc822")), - itemResponse(11, QStringLiteral("456"), QStringLiteral("1"), QStringLiteral("message/rfc822")) }); - QTest::newRow("intra-resource move, owning resource") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << List(QByteArray, "akonadi_imap_resource_0") - << List(QString, QStringLiteral("message/rfc822")) - << List(QByteArray, "akonadi_imap_resource_0") - << itemMsg.staticCast<Protocol::ChangeNotification>() - << true; - - colMsg = Protocol::CollectionChangeNotificationPtr::create(); - colMsg->setOperation(Protocol::CollectionChangeNotification::Add); - colMsg->setSessionId("kmail"); - colMsg->setResource("akonadi_resource_1"); - colMsg->setParentCollection(1); - QTest::newRow("new subfolder") - << false - << List(Entity::Id, 0) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << List(QString, QStringLiteral("message/rfc822")) - << EmptyList(QByteArray) - << colMsg.staticCast<Protocol::ChangeNotification>() - << false; - - itemMsg = Protocol::ItemChangeNotificationPtr::create(); - itemMsg->setOperation(Protocol::ItemChangeNotification::Add); - itemMsg->setSessionId("randomSession"); - itemMsg->setResource("randomResource"); - itemMsg->setParentCollection(1); - itemMsg->setItems({ itemResponse(10, QString(), QString(), QStringLiteral("message/rfc822")) }); - QTest::newRow("new mail for mailfilter or maildispatcher") - << false - << List(Entity::Id, 0) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << List(QString, QStringLiteral("message/rfc822")) - << EmptyList(QByteArray) - << itemMsg.staticCast<Protocol::ChangeNotification>() - << true; - - auto tagMsg = Protocol::TagChangeNotificationPtr::create(); - tagMsg->setOperation(Protocol::TagChangeNotification::Remove); - tagMsg->setSessionId("randomSession"); - tagMsg->setResource("akonadi_random_resource_0"); - { - Protocol::FetchTagsResponse tagMsgTag; - tagMsgTag.setId(1); - tagMsgTag.setRemoteId("TAG"); - tagMsg->setTag(std::move(tagMsgTag)); - } - QTest::newRow("Tag removal - resource notification - matching resource source") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << EmptyList(QString) - << List(QByteArray, "akonadi_random_resource_0") - << tagMsg.staticCast<Protocol::ChangeNotification>() - << true; - - QTest::newRow("Tag removal - resource notification - wrong resource source") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << EmptyList(QString) - << List(QByteArray, "akonadi_another_resource_1") - << tagMsg.staticCast<Protocol::ChangeNotification>() - << false; - - tagMsg = Protocol::TagChangeNotificationPtr::create(); - tagMsg->setOperation(Protocol::TagChangeNotification::Remove); - tagMsg->setSessionId("randomSession"); - { - Protocol::FetchTagsResponse tagMsgTag; - tagMsgTag.setId(1); - tagMsgTag.setRemoteId("TAG"); - tagMsg->setTag(std::move(tagMsgTag)); - } - QTest::newRow("Tag removal - client notification - client source") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << EmptyList(QString) - << EmptyList(QByteArray) - << tagMsg.staticCast<Protocol::ChangeNotification>() - << true; - - QTest::newRow("Tag removal - client notification - resource source") - << false - << EmptyList(Entity::Id) - << EmptyList(Entity::Id) - << EmptyList(QByteArray) - << EmptyList(QString) - << List( QByteArray, "akonadi_some_resource_0" ) - << tagMsg.staticCast<Protocol::ChangeNotification>() - << false; - } - - void testSourceFilter() - { - QFETCH(bool, allMonitored); - QFETCH(QVector<Entity::Id>, monitoredCollections); - QFETCH(QVector<Entity::Id>, monitoredItems); - QFETCH(QVector<QByteArray>, monitoredResources); - QFETCH(QVector<QString>, monitoredMimeTypes); - QFETCH(QVector<QByteArray>, ignoredSessions); - QFETCH(Protocol::ChangeNotificationPtr, notification); - QFETCH(bool, accepted); - - TestableNotificationSubscriber subscriber; - - subscriber.setAllMonitored(allMonitored); - Q_FOREACH (Entity::Id id, monitoredCollections) { - subscriber.setMonitoredCollection(id, true); - } - Q_FOREACH (Entity::Id id, monitoredItems) { - subscriber.setMonitoredItem(id, true); - } - Q_FOREACH (const QByteArray &res, monitoredResources) { - subscriber.setMonitoredResource(res, true); - } - Q_FOREACH (const QString &mimeType, monitoredMimeTypes) { - subscriber.setMonitoredMimeType(mimeType, true); - } - Q_FOREACH (const QByteArray &session, ignoredSessions) { - subscriber.setIgnoredSession(session, true); - } - - subscriber.notify({ notification }); - - QTRY_COMPARE(subscriber.emittedNotifications.count(), accepted ? 1 : 0); - - if (accepted) { - const Protocol::ChangeNotificationPtr ntf = subscriber.emittedNotifications.at(0); - QVERIFY(ntf->isValid()); - } - } -}; - -AKTEST_MAIN(NotificationManagerTest) - -#include "notificationmanagertest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/autotests/server/notificationsubscribertest.cpp new/akonadi-18.12.2/autotests/server/notificationsubscribertest.cpp --- old/akonadi-18.12.1/autotests/server/notificationsubscribertest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/akonadi-18.12.2/autotests/server/notificationsubscribertest.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -0,0 +1,403 @@ +/* + Copyright (c) 2013 Daniel Vrátil <dvra...@redhat.com> + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 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 Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#include <aktest.h> + +#include "entities.h" +#include "notificationsubscriber.h" + +#include <QObject> +#include <QTest> + +using namespace Akonadi; +using namespace Akonadi::Server; + +Q_DECLARE_METATYPE(QVector<QString>) + +class TestableNotificationSubscriber : public NotificationSubscriber +{ +public: + TestableNotificationSubscriber() + : NotificationSubscriber() + { + mSubscriber = "TestSubscriber"; + } + + void setAllMonitored(bool allMonitored) + { + mAllMonitored = allMonitored; + } + + void setMonitoredCollection(qint64 collection, bool monitored) + { + if (monitored) { + mMonitoredCollections.insert(collection); + } else { + mMonitoredCollections.remove(collection); + } + } + + void setMonitoredItem(qint64 item, bool monitored) + { + if (monitored) { + mMonitoredItems.insert(item); + } else { + mMonitoredItems.remove(item); + } + } + + void setMonitoredResource(const QByteArray &resource, bool monitored) + { + if (monitored) { + mMonitoredResources.insert(resource); + } else { + mMonitoredResources.remove(resource); + } + } + + void setMonitoredMimeType(const QString &mimeType, bool monitored) + { + if (monitored) { + mMonitoredMimeTypes.insert(mimeType); + } else { + mMonitoredMimeTypes.remove(mimeType); + } + } + + void setIgnoredSession(const QByteArray &session, bool ignored) + { + if (ignored) { + mIgnoredSessions.insert(session); + } else { + mIgnoredSessions.remove(session); + } + } + + void writeNotification(const Protocol::ChangeNotificationPtr ¬ification) override + { + emittedNotifications << notification; + } + + Protocol::ChangeNotificationList emittedNotifications; +}; + +class NotificationSubscriberTest : public QObject +{ + Q_OBJECT + + typedef QList<NotificationSubscriber *> NSList; + + + Protocol::FetchItemsResponse itemResponse(qint64 id, const QString &rid, const QString &rrev, const QString &mt) + { + Protocol::FetchItemsResponse item; + item.setId(id); + item.setRemoteId(rid); + item.setRemoteRevision(rrev); + item.setMimeType(mt); + return item; + } + +private Q_SLOTS: + void testSourceFilter_data() + { + qRegisterMetaType<Protocol::ChangeNotificationList>(); + + QTest::addColumn<bool>("allMonitored"); + QTest::addColumn<QVector<Entity::Id> >("monitoredCollections"); + QTest::addColumn<QVector<Entity::Id> >("monitoredItems"); + QTest::addColumn<QVector<QByteArray> >("monitoredResources"); + QTest::addColumn<QVector<QString> >("monitoredMimeTypes"); + QTest::addColumn<QVector<QByteArray> >("ignoredSessions"); + QTest::addColumn<Protocol::ChangeNotificationPtr>("notification"); + QTest::addColumn<bool>("accepted"); + +#define EmptyList(T) (QVector<T>()) +#define List(T,x) (QVector<T>() << x) + + auto itemMsg = Protocol::ItemChangeNotificationPtr::create(); + itemMsg->setOperation(Protocol::ItemChangeNotification::Add); + itemMsg->setParentCollection(1); + QTest::newRow("monitorAll vs notification without items") + << true + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << EmptyList(QString) + << EmptyList(QByteArray) + << itemMsg.staticCast<Protocol::ChangeNotification>() + << false; + + itemMsg = Protocol::ItemChangeNotificationPtr::create(*itemMsg); + itemMsg->setItems({ itemResponse(1, QString(), QString(), QStringLiteral("message/rfc822")) }); + QTest::newRow("monitorAll vs notification with one item") + << true + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << EmptyList(QString) + << EmptyList(QByteArray) + << itemMsg.staticCast<Protocol::ChangeNotification>() + << true; + + QTest::newRow("item monitored but different mimetype") + << false + << EmptyList(Entity::Id) + << List(Entity::Id, 1 << 2) + << EmptyList(QByteArray) + << List(QString, QStringLiteral("random/mimetype")) + << EmptyList(QByteArray) + << Protocol::ItemChangeNotificationPtr::create(*itemMsg).staticCast<Protocol::ChangeNotification>() + << false; + + QTest::newRow("item not monitored, but mimetype matches") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << List(QString, QStringLiteral("message/rfc822")) + << EmptyList(QByteArray) + << Protocol::ItemChangeNotificationPtr::create(*itemMsg).staticCast<Protocol::ChangeNotification>() + << true; + + itemMsg = Protocol::ItemChangeNotificationPtr::create(*itemMsg); + itemMsg->setSessionId("testSession"); + QTest::newRow("item monitored but session ignored") + << false + << EmptyList(Entity::Id) + << List(Entity::Id, 1) + << EmptyList(QByteArray) + << EmptyList(QString) + << List(QByteArray, "testSession") + << itemMsg.staticCast<Protocol::ChangeNotification>() + << false; + + // Simulate adding a new resource + auto colMsg = Protocol::CollectionChangeNotificationPtr::create(); + colMsg->setOperation(Protocol::CollectionChangeNotification::Add); + Protocol::FetchCollectionsResponse col; + col.setId(1); + col.setRemoteId(QStringLiteral("imap://user@some.domain/")); + colMsg->setCollection(std::move(col)); + colMsg->setParentCollection(0); + colMsg->setSessionId("akonadi_imap_resource_0"); + colMsg->setResource("akonadi_imap_resource_0"); + QTest::newRow("new root collection in non-monitored resource") + << false + << List(Entity::Id, 0) + << EmptyList(Entity::Id) + << List(QByteArray, "akonadi_search_resource") + << List(QString, QStringLiteral("message/rfc822")) + << EmptyList(QByteArray) + << colMsg.staticCast<Protocol::ChangeNotification>() + << true; + + itemMsg = Protocol::ItemChangeNotificationPtr::create(); + itemMsg->setOperation(Protocol::ItemChangeNotification::Move); + itemMsg->setResource("akonadi_resource_1"); + itemMsg->setDestinationResource("akonadi_resource_2"); + itemMsg->setParentCollection(1); + itemMsg->setParentDestCollection(2); + itemMsg->setSessionId("kmail"); + itemMsg->setItems({ itemResponse(10, QStringLiteral("123"), QStringLiteral("1"), QStringLiteral("message/rfc822")) }); + QTest::newRow("inter-resource move, source source") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << List(QByteArray, "akonadi_resource_1") + << List(QString, QStringLiteral("message/rfc822")) + << List(QByteArray, "akonadi_resource_1") + << itemMsg.staticCast<Protocol::ChangeNotification>() + << true; + + QTest::newRow("inter-resource move, destination source") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << List(QByteArray, "akonadi_resource_2") + << List(QString, QStringLiteral("message/rfc822")) + << List(QByteArray, "akonadi_resource_2") + << itemMsg.staticCast<Protocol::ChangeNotification>() + << true; + + QTest::newRow("inter-resource move, uninterested party") + << false + << List(Entity::Id, 12) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << List(QString, QStringLiteral("inode/directory")) + << EmptyList(QByteArray) + << itemMsg.staticCast<Protocol::ChangeNotification>() + << false; + + itemMsg = Protocol::ItemChangeNotificationPtr::create(); + itemMsg->setOperation(Protocol::ItemChangeNotification::Move); + itemMsg->setResource("akonadi_resource_0"); + itemMsg->setDestinationResource("akonadi_resource_0"); + itemMsg->setParentCollection(1); + itemMsg->setParentDestCollection(2); + itemMsg->setSessionId("kmail"); + itemMsg->setItems({ + itemResponse(10, QStringLiteral("123"), QStringLiteral("1"), QStringLiteral("message/rfc822")), + itemResponse(11, QStringLiteral("456"), QStringLiteral("1"), QStringLiteral("message/rfc822")) }); + QTest::newRow("intra-resource move, owning resource") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << List(QByteArray, "akonadi_imap_resource_0") + << List(QString, QStringLiteral("message/rfc822")) + << List(QByteArray, "akonadi_imap_resource_0") + << itemMsg.staticCast<Protocol::ChangeNotification>() + << true; + + colMsg = Protocol::CollectionChangeNotificationPtr::create(); + colMsg->setOperation(Protocol::CollectionChangeNotification::Add); + colMsg->setSessionId("kmail"); + colMsg->setResource("akonadi_resource_1"); + colMsg->setParentCollection(1); + QTest::newRow("new subfolder") + << false + << List(Entity::Id, 0) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << List(QString, QStringLiteral("message/rfc822")) + << EmptyList(QByteArray) + << colMsg.staticCast<Protocol::ChangeNotification>() + << false; + + itemMsg = Protocol::ItemChangeNotificationPtr::create(); + itemMsg->setOperation(Protocol::ItemChangeNotification::Add); + itemMsg->setSessionId("randomSession"); + itemMsg->setResource("randomResource"); + itemMsg->setParentCollection(1); + itemMsg->setItems({ itemResponse(10, QString(), QString(), QStringLiteral("message/rfc822")) }); + QTest::newRow("new mail for mailfilter or maildispatcher") + << false + << List(Entity::Id, 0) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << List(QString, QStringLiteral("message/rfc822")) + << EmptyList(QByteArray) + << itemMsg.staticCast<Protocol::ChangeNotification>() + << true; + + auto tagMsg = Protocol::TagChangeNotificationPtr::create(); + tagMsg->setOperation(Protocol::TagChangeNotification::Remove); + tagMsg->setSessionId("randomSession"); + tagMsg->setResource("akonadi_random_resource_0"); + { + Protocol::FetchTagsResponse tagMsgTag; + tagMsgTag.setId(1); + tagMsgTag.setRemoteId("TAG"); + tagMsg->setTag(std::move(tagMsgTag)); + } + QTest::newRow("Tag removal - resource notification - matching resource source") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << EmptyList(QString) + << List(QByteArray, "akonadi_random_resource_0") + << tagMsg.staticCast<Protocol::ChangeNotification>() + << true; + + QTest::newRow("Tag removal - resource notification - wrong resource source") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << EmptyList(QString) + << List(QByteArray, "akonadi_another_resource_1") + << tagMsg.staticCast<Protocol::ChangeNotification>() + << false; + + tagMsg = Protocol::TagChangeNotificationPtr::create(); + tagMsg->setOperation(Protocol::TagChangeNotification::Remove); + tagMsg->setSessionId("randomSession"); + { + Protocol::FetchTagsResponse tagMsgTag; + tagMsgTag.setId(1); + tagMsgTag.setRemoteId("TAG"); + tagMsg->setTag(std::move(tagMsgTag)); + } + QTest::newRow("Tag removal - client notification - client source") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << EmptyList(QString) + << EmptyList(QByteArray) + << tagMsg.staticCast<Protocol::ChangeNotification>() + << true; + + QTest::newRow("Tag removal - client notification - resource source") + << false + << EmptyList(Entity::Id) + << EmptyList(Entity::Id) + << EmptyList(QByteArray) + << EmptyList(QString) + << List( QByteArray, "akonadi_some_resource_0" ) + << tagMsg.staticCast<Protocol::ChangeNotification>() + << false; + } + + void testSourceFilter() + { + QFETCH(bool, allMonitored); + QFETCH(QVector<Entity::Id>, monitoredCollections); + QFETCH(QVector<Entity::Id>, monitoredItems); + QFETCH(QVector<QByteArray>, monitoredResources); + QFETCH(QVector<QString>, monitoredMimeTypes); + QFETCH(QVector<QByteArray>, ignoredSessions); + QFETCH(Protocol::ChangeNotificationPtr, notification); + QFETCH(bool, accepted); + + TestableNotificationSubscriber subscriber; + + subscriber.setAllMonitored(allMonitored); + Q_FOREACH (Entity::Id id, monitoredCollections) { + subscriber.setMonitoredCollection(id, true); + } + Q_FOREACH (Entity::Id id, monitoredItems) { + subscriber.setMonitoredItem(id, true); + } + Q_FOREACH (const QByteArray &res, monitoredResources) { + subscriber.setMonitoredResource(res, true); + } + Q_FOREACH (const QString &mimeType, monitoredMimeTypes) { + subscriber.setMonitoredMimeType(mimeType, true); + } + Q_FOREACH (const QByteArray &session, ignoredSessions) { + subscriber.setIgnoredSession(session, true); + } + + subscriber.notify({ notification }); + + QTRY_COMPARE(subscriber.emittedNotifications.count(), accepted ? 1 : 0); + + if (accepted) { + const Protocol::ChangeNotificationPtr ntf = subscriber.emittedNotifications.at(0); + QVERIFY(ntf->isValid()); + } + } +}; + +AKTEST_MAIN(NotificationSubscriberTest) + +#include "notificationsubscribertest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/po/fr/libakonadi5.po new/akonadi-18.12.2/po/fr/libakonadi5.po --- old/akonadi-18.12.1/po/fr/libakonadi5.po 2019-01-08 01:17:34.000000000 +0100 +++ new/akonadi-18.12.2/po/fr/libakonadi5.po 2019-02-05 01:44:31.000000000 +0100 @@ -6,7 +6,7 @@ # Sébastien Renard <ren...@kde.org>, 2012, 2013, 2014. # xavier <xavier.besn...@neuf.fr>, 2012, 2013. # Vincent Pinon <vpi...@kde.org>, 2017, 2018. -# Simon Depiets <sdepi...@gmail.com>, 2018. +# Simon Depiets <sdepi...@gmail.com>, 2018, 2019. # msgid "" msgstr "" @@ -21,7 +21,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Lokalize 2.0\n" +"X-Generator: Lokalize 19.03.70\n" "X-Environment: kde\n" "X-Accelerator-Marker: &\n" "X-Text-Markup: kde4\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/po/pl/libakonadi5.po new/akonadi-18.12.2/po/pl/libakonadi5.po --- old/akonadi-18.12.1/po/pl/libakonadi5.po 2019-01-08 01:17:34.000000000 +0100 +++ new/akonadi-18.12.2/po/pl/libakonadi5.po 2019-02-05 01:44:32.000000000 +0100 @@ -1,13 +1,13 @@ # Copyright (C) YEAR This_file_is_part_of_KDE # This file is distributed under the same license as the PACKAGE package. # -# Łukasz Wojniłowicz <lukasz.wojnilow...@gmail.com>, 2014, 2015, 2016, 2017, 2018. +# Łukasz Wojniłowicz <lukasz.wojnilow...@gmail.com>, 2014, 2015, 2016, 2017, 2018, 2019. msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2018-12-12 07:57+0100\n" -"PO-Revision-Date: 2018-11-04 08:27+0100\n" +"PO-Revision-Date: 2019-01-20 07:47+0100\n" "Last-Translator: Łukasz Wojniłowicz <lukasz.wojnilow...@gmail.com>\n" "Language-Team: Polish <kde-i18n-...@kde.org>\n" "Language: pl\n" @@ -16,7 +16,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" -"X-Generator: Lokalize 2.0\n" +"X-Generator: Lokalize 19.03.70\n" #, kde-format msgctxt "NAME OF TRANSLATORS" @@ -151,7 +151,7 @@ #, kde-format msgctxt "@info" msgid "Job canceled." -msgstr "Anulowano zadanie." +msgstr "Porzucono zadanie." #: core/collectionpathresolver.cpp:113 core/collectionpathresolver.cpp:132 #, kde-format @@ -965,7 +965,7 @@ #: widgets/collectionview.cpp:232 #, kde-format msgid "Cancel" -msgstr "Anuluj" +msgstr "Zaniechaj" #: widgets/conflictresolvedialog.cpp:142 #, kde-format @@ -1056,7 +1056,7 @@ #: widgets/dragdropmanager.cpp:244 #, kde-format msgid "C&ancel" -msgstr "&Anuluj" +msgstr "Z&aniechaj" #: widgets/erroroverlay.cpp:241 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/po/zh_CN/akonadi_knut_resource.po new/akonadi-18.12.2/po/zh_CN/akonadi_knut_resource.po --- old/akonadi-18.12.1/po/zh_CN/akonadi_knut_resource.po 2019-01-08 01:17:35.000000000 +0100 +++ new/akonadi-18.12.2/po/zh_CN/akonadi_knut_resource.po 2019-02-05 01:44:33.000000000 +0100 @@ -8,7 +8,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2018-11-12 06:56+0100\n" -"PO-Revision-Date: 2019-01-05 20:50\n" +"PO-Revision-Date: 2019-01-27 23:05\n" "Last-Translator: guoyunhe <i...@guoyunhe.me>\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/po/zh_CN/libakonadi5.po new/akonadi-18.12.2/po/zh_CN/libakonadi5.po --- old/akonadi-18.12.1/po/zh_CN/libakonadi5.po 2019-01-08 01:17:35.000000000 +0100 +++ new/akonadi-18.12.2/po/zh_CN/libakonadi5.po 2019-02-05 01:44:33.000000000 +0100 @@ -8,7 +8,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2018-12-12 07:57+0100\n" -"PO-Revision-Date: 2019-01-05 20:50\n" +"PO-Revision-Date: 2019-01-27 23:05\n" "Last-Translator: guoyunhe <i...@guoyunhe.me>\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/po/zh_TW/libakonadi5.po new/akonadi-18.12.2/po/zh_TW/libakonadi5.po --- old/akonadi-18.12.1/po/zh_TW/libakonadi5.po 2019-01-08 01:17:35.000000000 +0100 +++ new/akonadi-18.12.2/po/zh_TW/libakonadi5.po 2019-02-05 01:44:33.000000000 +0100 @@ -82,17 +82,13 @@ msgstr "未設定" #: agentbase/resourcebase.cpp:571 -#, fuzzy, kde-format -#| msgctxt "@label commandline option" -#| msgid "Resource identifier" +#, kde-format msgctxt "@label command line option" msgid "Resource identifier" msgstr "資源辨識器" #: agentbase/resourcebase.cpp:578 -#, fuzzy, kde-format -#| msgctxt "@title application name" -#| msgid "Akonadi Resource" +#, kde-format msgid "Akonadi Resource" msgstr "Akonadi 資源" @@ -2112,9 +2108,7 @@ msgstr[0] "同步 %1 個資料夾" #: widgets/standardactionmanager.cpp:239 -#, fuzzy, kde-format -#| msgctxt "@title:column, name of a thing" -#| msgid "Name" +#, kde-format msgctxt "@label:textbox name of Akonadi folder" msgid "Name" msgstr "名稱" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/src/core/collectionutils.h new/akonadi-18.12.2/src/core/collectionutils.h --- old/akonadi-18.12.1/src/core/collectionutils.h 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/src/core/collectionutils.h 2019-02-02 18:10:04.000000000 +0100 @@ -67,6 +67,11 @@ collection.resource() != QLatin1String("akonadi_search_resource")); } +Q_REQUIRED_RESULT inline bool isUnifiedMailbox(const Collection &collection) +{ + return collection.resource() == QLatin1String("akonadi_unifiedmailbox_agent"); +} + Q_REQUIRED_RESULT inline QString defaultIconName(const Collection &col) { if (CollectionUtils::isVirtualParent(col)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/src/core/models/subscriptionmodel.cpp new/akonadi-18.12.2/src/core/models/subscriptionmodel.cpp --- old/akonadi-18.12.1/src/core/models/subscriptionmodel.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/src/core/models/subscriptionmodel.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -75,7 +75,7 @@ bool isSubscribable(Collection::Id id) { Collection col = q->collectionForId(id); - if (CollectionUtils::isStructural(col) || col.isVirtual()) { + if (CollectionUtils::isStructural(col) || col.isVirtual() || CollectionUtils::isUnifiedMailbox(col)) { return false; } if (col.hasAttribute<SpecialCollectionAttribute>()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/src/core/tag.cpp new/akonadi-18.12.2/src/core/tag.cpp --- old/akonadi-18.12.1/src/core/tag.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/src/core/tag.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -245,7 +245,8 @@ QDebug &operator<<(QDebug &debug, const Tag &tag) { - debug << "Akonadi::Tag( ID " << tag.id() << ", GID " << tag.gid() << ", parent" << tag.parent().id() << ")"; + QDebugStateSaver saver(debug); + debug.nospace() << "Akonadi::Tag(ID " << tag.id() << ", GID " << tag.gid() << ", parent tag ID " << tag.parent().id() << ")"; return debug; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/src/server/aggregatedfetchscope.cpp new/akonadi-18.12.2/src/server/aggregatedfetchscope.cpp --- old/akonadi-18.12.1/src/server/aggregatedfetchscope.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/src/server/aggregatedfetchscope.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -89,6 +89,7 @@ public: QSet<QByteArray> attrs; QHash<QByteArray, int> attrsCount; + int subscribers = 0; int fetchIdOnly = 0; int fetchStats = 0; }; @@ -99,6 +100,7 @@ public: QSet<QByteArray> attrs; QHash<QByteArray, int> attrsCount; + int subscribers = 0; int fetchIdOnly = 0; int fetchRemoteId = 0; int fetchAllAttributes = 0; @@ -114,6 +116,7 @@ QHash<QByteArray, int> partsCount; QSet<QByteArray> tags; QHash<QByteArray, int> tagsCount; + int subscribers = 0; int ancestors[3] = { 0, 0, 0 }; // 3 = size of AncestorDepth enum int cacheOnly = 0; int fullPayload = 0; @@ -186,7 +189,7 @@ LOCKED_D(const AggregatedCollectionFetchScope) // Aggregation: we can return true only if everyone wants fetchIdOnly, // otherwise there's at least one subscriber who wants everything - return d->fetchIdOnly == 0; + return d->fetchIdOnly == d->subscribers; } void AggregatedCollectionFetchScope::setFetchIdOnly(bool fetchIdOnly) @@ -208,6 +211,17 @@ d->updateBool(fetchStats, d->fetchStats); } +void AggregatedCollectionFetchScope::addSubscriber() +{ + LOCKED_D(AggregatedCollectionFetchScope) + ++d->subscribers; +} + +void AggregatedCollectionFetchScope::removeSubscriber() +{ + LOCKED_D(AggregatedCollectionFetchScope) + --d->subscribers; +} AggregatedItemFetchScope::AggregatedItemFetchScope() @@ -350,7 +364,7 @@ LOCKED_D(const AggregatedItemFetchScope) // Aggregation: we can return true only if everyone wants cached data only, // otherwise there's at least one subscriber who wants uncached data - return d->cacheOnly == 0; + return d->cacheOnly == d->subscribers; } void AggregatedItemFetchScope::setCacheOnly(bool cacheOnly) @@ -431,7 +445,7 @@ LOCKED_D(const AggregatedItemFetchScope) // Aggregation: return true only if everyone wants to ignore errors, otherwise // there's at least one subscriber who does not want to ignore them - return d->ignoreErrors == 0; + return d->ignoreErrors == d->subscribers; } void AggregatedItemFetchScope::setIgnoreErrors(bool ignoreErrors) @@ -518,7 +532,17 @@ d->updateBool(fetchVRefs, d->fetchVRefs); } +void AggregatedItemFetchScope::addSubscriber() +{ + LOCKED_D(AggregatedItemFetchScope) + ++d->subscribers; +} +void AggregatedItemFetchScope::removeSubscriber() +{ + LOCKED_D(AggregatedItemFetchScope) + --d->subscribers; +} @@ -567,7 +591,7 @@ LOCKED_D(const AggregatedTagFetchScope) // Aggregation: we can return true only if everyone wants fetchIdOnly, // otherwise there's at least one subscriber who wants everything - return d->fetchIdOnly == 0; + return d->fetchIdOnly == d->subscribers; } void AggregatedTagFetchScope::setFetchIdOnly(bool fetchIdOnly) @@ -618,4 +642,16 @@ d->removeFromSet(attribute, d->attrs, d->attrsCount); } +void AggregatedTagFetchScope::addSubscriber() +{ + LOCKED_D(AggregatedTagFetchScope) + ++d->subscribers; +} + +void AggregatedTagFetchScope::removeSubscriber() +{ + LOCKED_D(AggregatedTagFetchScope) + --d->subscribers; +} + #undef LOCKED_D diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/src/server/aggregatedfetchscope.h new/akonadi-18.12.2/src/server/aggregatedfetchscope.h --- old/akonadi-18.12.1/src/server/aggregatedfetchscope.h 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/src/server/aggregatedfetchscope.h 2019-02-02 18:10:04.000000000 +0100 @@ -49,6 +49,9 @@ bool fetchStatistics() const; void setFetchStatistics(bool fetchStats); + void addSubscriber(); + void removeSubscriber(); + private: AggregatedCollectionFetchScopePrivate * const d_ptr; Q_DECLARE_PRIVATE(AggregatedCollectionFetchScope) @@ -100,6 +103,9 @@ bool fetchVirtualReferences() const; void setFetchVirtualReferences(bool fetchVRefs); + void addSubscriber(); + void removeSubscriber(); + private: AggregatedItemFetchScopePrivate * const d_ptr; Q_DECLARE_PRIVATE(AggregatedItemFetchScope) @@ -121,6 +127,9 @@ void addAttribute(const QByteArray &attribute); void removeAttribute(const QByteArray &attribute); + void addSubscriber(); + void removeSubscriber(); + bool fetchIdOnly() const; void setFetchIdOnly(bool fetchIdOnly); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/src/server/notificationsubscriber.cpp new/akonadi-18.12.2/src/server/notificationsubscriber.cpp --- old/akonadi-18.12.1/src/server/notificationsubscriber.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/src/server/notificationsubscriber.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -48,6 +48,11 @@ , mExclusive(false) , mNotificationDebugging(false) { + if (mManager) { + mManager->itemFetchScope()->addSubscriber(); + mManager->collectionFetchScope()->addSubscriber(); + mManager->tagFetchScope()->addSubscriber(); + } } NotificationSubscriber::NotificationSubscriber(NotificationManager *manager, quintptr socketDescriptor) @@ -163,6 +168,13 @@ for (const auto &attr : attrs) { cfs->removeAttribute(attr); } + cfs->removeSubscriber(); + + auto tfs = mManager->tagFetchScope(); + tfs->removeSubscriber(); + + auto ifs = mManager->itemFetchScope(); + ifs->removeSubscriber(); mManager->forgetSubscriber(this); deleteLater(); @@ -268,6 +280,8 @@ const auto newScope = command.tagFetchScope(); mManager->tagFetchScope()->apply(mTagFetchScope, newScope); mTagFetchScope = newScope; + if (!newScope.fetchIdOnly()) + Q_ASSERT(!mManager->tagFetchScope()->fetchIdOnly()); } if (mManager) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-18.12.1/src/server/storage/dbconfigmysql.cpp new/akonadi-18.12.2/src/server/storage/dbconfigmysql.cpp --- old/akonadi-18.12.1/src/server/storage/dbconfigmysql.cpp 2019-01-04 17:42:13.000000000 +0100 +++ new/akonadi-18.12.2/src/server/storage/dbconfigmysql.cpp 2019-02-02 18:10:04.000000000 +0100 @@ -58,6 +58,25 @@ return mDatabaseName; } +static QString findExecutable(const QString &bin) +{ + static const QStringList mysqldSearchPath = { + QStringLiteral("/usr/bin"), + QStringLiteral("/usr/sbin"), + QStringLiteral("/usr/local/sbin"), + QStringLiteral("/usr/local/libexec"), + QStringLiteral("/usr/libexec"), + QStringLiteral("/opt/mysql/libexec"), + QStringLiteral("/opt/local/lib/mysql5/bin"), + QStringLiteral("/opt/mysql/sbin"), + }; + QString path = QStandardPaths::findExecutable(bin); + if (path.isEmpty()) { // No results in PATH; fall back to hardcoded list. + path = QStandardPaths::findExecutable(bin, mysqldSearchPath); + } + return path; +} + bool DbConfigMysql::init(QSettings &settings) { // determine default settings depending on the driver @@ -76,20 +95,11 @@ defaultServerPath = QStringLiteral(MYSQLD_EXECUTABLE); } #endif - const QStringList mysqldSearchPath = QStringList() - << QStringLiteral("/usr/bin") - << QStringLiteral("/usr/sbin") - << QStringLiteral("/usr/local/sbin") - << QStringLiteral("/usr/local/libexec") - << QStringLiteral("/usr/libexec") - << QStringLiteral("/opt/mysql/libexec") - << QStringLiteral("/opt/local/lib/mysql5/bin") - << QStringLiteral("/opt/mysql/sbin"); if (defaultServerPath.isEmpty()) { - defaultServerPath = QStandardPaths::findExecutable(QStringLiteral("mysqld"), mysqldSearchPath); + defaultServerPath = findExecutable(QStringLiteral("mysqld")); } - const QString mysqladminPath = QStandardPaths::findExecutable(QStringLiteral("mysqladmin"), mysqldSearchPath); + const QString mysqladminPath = findExecutable(QStringLiteral("mysqladmin")); if (!mysqladminPath.isEmpty()) { #ifndef Q_OS_WIN defaultCleanShutdownCommand = QStringLiteral("%1 --defaults-file=%2/mysql.conf --socket=%3/mysql.socket shutdown") @@ -99,10 +109,10 @@ #endif } - mMysqlInstallDbPath = QStandardPaths::findExecutable(QStringLiteral("mysql_install_db"), mysqldSearchPath); + mMysqlInstallDbPath = findExecutable(QStringLiteral("mysql_install_db")); qCDebug(AKONADISERVER_LOG) << "Found mysql_install_db: " << mMysqlInstallDbPath; - mMysqlCheckPath = QStandardPaths::findExecutable(QStringLiteral("mysqlcheck"), mysqldSearchPath); + mMysqlCheckPath = findExecutable(QStringLiteral("mysqlcheck")); qCDebug(AKONADISERVER_LOG) << "Found mysqlcheck: " << mMysqlCheckPath; mInternalServer = settings.value(QStringLiteral("QMYSQL/StartServer"), defaultInternalServer).toBool();