Changeset View
Changeset View
Standalone View
Standalone View
tests/testlib/gencollection.cpp
Show All 18 Lines | 1 | /* This file is part of Zanshin | |||
---|---|---|---|---|---|
19 | along with this program; if not, write to the Free Software | 19 | along with this program; if not, write to the Free Software | ||
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 "gencollection.h" | 24 | #include "gencollection.h" | ||
25 | 25 | | |||
26 | #include <AkonadiCore/EntityDisplayAttribute> | 26 | #include <AkonadiCore/EntityDisplayAttribute> | ||
27 | #include <Akonadi/Notes/NoteUtils> | | |||
28 | 27 | | |||
29 | #include <KCalCore/Todo> | 28 | #include <KCalCore/Todo> | ||
30 | 29 | | |||
31 | #include "akonadi/akonadiapplicationselectedattribute.h" | 30 | #include "akonadi/akonadiapplicationselectedattribute.h" | ||
32 | 31 | | |||
33 | using namespace Testlib; | 32 | using namespace Testlib; | ||
34 | 33 | | |||
35 | GenCollection::GenCollection(const Akonadi::Collection &collection) | 34 | GenCollection::GenCollection(const Akonadi::Collection &collection) | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 91 | } else if (!mimeTypes.contains(KCalCore::Todo::todoMimeType())) { | |||
93 | mimeTypes.append(KCalCore::Todo::todoMimeType()); | 92 | mimeTypes.append(KCalCore::Todo::todoMimeType()); | ||
94 | } | 93 | } | ||
95 | m_collection.setContentMimeTypes(mimeTypes); | 94 | m_collection.setContentMimeTypes(mimeTypes); | ||
96 | return *this; | 95 | return *this; | ||
97 | } | 96 | } | ||
98 | 97 | | |||
99 | GenCollection &GenCollection::withNoteContent(bool value) | 98 | GenCollection &GenCollection::withNoteContent(bool value) | ||
100 | { | 99 | { | ||
100 | const auto noteMime = QString("text/x-vnd.akonadi.note"); | ||||
dfaure: that makes it QStringLiteral, I thought this was a crash risk. | |||||
101 | auto mimeTypes = m_collection.contentMimeTypes(); | 101 | auto mimeTypes = m_collection.contentMimeTypes(); | ||
102 | if (!value) { | 102 | if (!value) { | ||
103 | mimeTypes.removeAll(Akonadi::NoteUtils::noteMimeType()); | 103 | mimeTypes.removeAll(noteMime); | ||
104 | } else if (!mimeTypes.contains(Akonadi::NoteUtils::noteMimeType())) { | 104 | } else if (!mimeTypes.contains(noteMime)) { | ||
105 | mimeTypes.append(Akonadi::NoteUtils::noteMimeType()); | 105 | mimeTypes.append(noteMime); | ||
106 | } | 106 | } | ||
107 | m_collection.setContentMimeTypes(mimeTypes); | 107 | m_collection.setContentMimeTypes(mimeTypes); | ||
108 | return *this; | 108 | return *this; | ||
109 | } | 109 | } |
that makes it QStringLiteral, I thought this was a crash risk.