Changeset View
Changeset View
Standalone View
Standalone View
resources/kolab/pimkolab/conversion/kolabconversion.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 25 | { | |||
---|---|---|---|---|---|
56 | 56 | | |||
57 | std::vector<Kolab::Attachment> attachments; | 57 | std::vector<Kolab::Attachment> attachments; | ||
58 | attachments.reserve(note.attachments().count()); | 58 | attachments.reserve(note.attachments().count()); | ||
59 | foreach (const Akonadi::NoteUtils::Attachment &a, note.attachments()) { | 59 | foreach (const Akonadi::NoteUtils::Attachment &a, note.attachments()) { | ||
60 | Kolab::Attachment attachment; | 60 | Kolab::Attachment attachment; | ||
61 | if (a.url().isValid()) { | 61 | if (a.url().isValid()) { | ||
62 | attachment.setUri(toStdString(a.url().toString()), toStdString(a.mimetype())); | 62 | attachment.setUri(toStdString(a.url().toString()), toStdString(a.mimetype())); | ||
63 | } else { | 63 | } else { | ||
64 | attachment.setData(toStdString(QString(a.data())), toStdString(a.mimetype())); | 64 | attachment.setData(toStdString(QString::fromUtf8(a.data())), toStdString(a.mimetype())); | ||
65 | } | 65 | } | ||
66 | attachment.setLabel(toStdString(a.label())); | 66 | attachment.setLabel(toStdString(a.label())); | ||
67 | attachments.push_back(attachment); | 67 | attachments.push_back(attachment); | ||
68 | } | 68 | } | ||
69 | n.setAttachments(attachments); | 69 | n.setAttachments(attachments); | ||
70 | 70 | | |||
71 | return n; | 71 | return n; | ||
72 | } | 72 | } | ||
Show All 39 Lines |