Changeset View
Changeset View
Standalone View
Standalone View
tests/testlib/akonadifakedata.cpp
Show All 19 Lines | 1 | /* This file is part of Zanshin | |||
---|---|---|---|---|---|
20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
21 | USA. | 21 | USA. | ||
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | #include "akonadifakedata.h" | 24 | #include "akonadifakedata.h" | ||
25 | #include "akonadifakemonitor.h" | 25 | #include "akonadifakemonitor.h" | ||
26 | #include "akonadifakestorage.h" | 26 | #include "akonadifakestorage.h" | ||
27 | 27 | | |||
28 | #include <Akonadi/Notes/NoteUtils> | | |||
29 | #include <KCalCore/Todo> | 28 | #include <KCalCore/Todo> | ||
30 | 29 | | |||
31 | #include "akonadi/akonadiapplicationselectedattribute.h" | 30 | #include "akonadi/akonadiapplicationselectedattribute.h" | ||
32 | 31 | | |||
33 | #include <algorithm> | 32 | #include <algorithm> | ||
34 | 33 | | |||
35 | using namespace Testlib; | 34 | using namespace Testlib; | ||
36 | 35 | | |||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 129 | if (oldParentId != parentId) { | |||
131 | m_childCollections[oldParentId].removeAll(newCollection.id()); | 130 | m_childCollections[oldParentId].removeAll(newCollection.id()); | ||
132 | m_childCollections[parentId] << newCollection.id(); | 131 | m_childCollections[parentId] << newCollection.id(); | ||
133 | } | 132 | } | ||
134 | 133 | | |||
135 | auto notifiedCollection = reconstructAncestors(newCollection); | 134 | auto notifiedCollection = reconstructAncestors(newCollection); | ||
136 | m_monitor->changeCollection(notifiedCollection); | 135 | m_monitor->changeCollection(notifiedCollection); | ||
137 | 136 | | |||
138 | const auto mimeTypes = collection.contentMimeTypes(); | 137 | const auto mimeTypes = collection.contentMimeTypes(); | ||
139 | if (mimeTypes.contains(KCalCore::Todo::todoMimeType()) | 138 | if (mimeTypes.contains(KCalCore::Todo::todoMimeType())) { | ||
140 | || mimeTypes.contains(Akonadi::NoteUtils::noteMimeType())) { | | |||
141 | const auto oldAttribute = oldCollection.attribute<Akonadi::ApplicationSelectedAttribute>(); | 139 | const auto oldAttribute = oldCollection.attribute<Akonadi::ApplicationSelectedAttribute>(); | ||
142 | const auto oldSelected = oldAttribute ? oldAttribute->isSelected() : true; | 140 | const auto oldSelected = oldAttribute ? oldAttribute->isSelected() : true; | ||
143 | const auto newAttribute = newCollection.attribute<Akonadi::ApplicationSelectedAttribute>(); | 141 | const auto newAttribute = newCollection.attribute<Akonadi::ApplicationSelectedAttribute>(); | ||
144 | const auto newSelected = newAttribute ? newAttribute->isSelected() : true; | 142 | const auto newSelected = newAttribute ? newAttribute->isSelected() : true; | ||
145 | 143 | | |||
146 | if (oldSelected != newSelected) { | 144 | if (oldSelected != newSelected) { | ||
147 | m_monitor->changeCollectionSelection(notifiedCollection); | 145 | m_monitor->changeCollectionSelection(notifiedCollection); | ||
148 | } | 146 | } | ||
▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines |