Changeset View
Changeset View
Standalone View
Standalone View
messageviewer/src/viewer/partnodebodypart.cpp
Show All 27 Lines | 1 | /* | |||
---|---|---|---|---|---|
28 | Qt. If you modify this file, you may extend this exception to | 28 | Qt. If you modify this file, you may extend this exception to | ||
29 | your version of the file, but you are not obligated to do so. If | 29 | your version of the file, but you are not obligated to do so. If | ||
30 | you do not wish to do so, delete this exception statement from | 30 | you do not wish to do so, delete this exception statement from | ||
31 | your version. | 31 | your version. | ||
32 | */ | 32 | */ | ||
33 | 33 | | |||
34 | #include "partnodebodypart.h" | 34 | #include "partnodebodypart.h" | ||
35 | #include "messageviewer/nodehelper.h" | 35 | #include "messageviewer/nodehelper.h" | ||
36 | #include "messageviewer/objecttreeparser.h" | ||||
36 | #include "messageviewer_debug.h" | 37 | #include "messageviewer_debug.h" | ||
37 | #include <kmime/kmime_content.h> | 38 | #include <kmime/kmime_content.h> | ||
38 | 39 | | |||
39 | #include <QTextCodec> | 40 | #include <QTextCodec> | ||
40 | 41 | | |||
41 | using namespace MessageViewer; | 42 | using namespace MessageViewer; | ||
42 | 43 | | |||
43 | static int serial = 0; | 44 | static int serial = 0; | ||
44 | 45 | | |||
45 | PartNodeBodyPart::PartNodeBodyPart(KMime::Content *topLevelContent, KMime::Content *content, | 46 | PartNodeBodyPart::PartNodeBodyPart(ObjectTreeParser *otp, ProcessResult *result, KMime::Content *topLevelContent, KMime::Content *content, | ||
46 | NodeHelper *nodeHelper, const QTextCodec *codec) | 47 | NodeHelper *nodeHelper, const QTextCodec *codec) | ||
47 | : Interface::BodyPart(), mTopLevelContent(topLevelContent), mContent(content), mCodec(codec), | 48 | : Interface::BodyPart(), mTopLevelContent(topLevelContent), mContent(content), mCodec(codec), | ||
48 | mDefaultDisplay(Interface::BodyPart::None), mNodeHelper(nodeHelper) | 49 | mDefaultDisplay(Interface::BodyPart::None), mNodeHelper(nodeHelper) | ||
50 | , mObjectTreeParser(otp) | ||||
51 | , mProcessResult(result) | ||||
49 | {} | 52 | {} | ||
50 | 53 | | |||
51 | QString PartNodeBodyPart::makeLink(const QString &path) const | 54 | QString PartNodeBodyPart::makeLink(const QString &path) const | ||
52 | { | 55 | { | ||
53 | // FIXME: use a PRNG for the first arg, instead of a serial number | 56 | // FIXME: use a PRNG for the first arg, instead of a serial number | ||
54 | return QStringLiteral("x-kmail:/bodypart/%1/%2/%3") | 57 | return QStringLiteral("x-kmail:/bodypart/%1/%2/%3") | ||
55 | .arg(serial++).arg(mContent->index().toString()) | 58 | .arg(serial++).arg(mContent->index().toString()) | ||
56 | .arg(QString::fromLatin1(QUrl::toPercentEncoding(path, "/"))); | 59 | .arg(QString::fromLatin1(QUrl::toPercentEncoding(path, "/"))); | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |