Changeset View
Changeset View
Standalone View
Standalone View
messageviewer/src/viewer/objecttreeemptysource.cpp
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. | ||
14 | 14 | | |||
15 | You should have received a copy of the GNU General Public License along | 15 | You should have received a copy of the GNU General Public License along | ||
16 | with this program; if not, write to the Free Software Foundation, Inc., | 16 | with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "objecttreeemptysource.h" | 20 | #include "objecttreeemptysource.h" | ||
21 | #include "viewer/attachmentstrategy.h" | ||||
21 | #include "viewer/viewer_p.h" | 22 | #include "viewer/viewer_p.h" | ||
22 | #include "viewer/csshelperbase.h" | 23 | #include "viewer/csshelperbase.h" | ||
23 | 24 | | |||
24 | #include <MimeTreeParser/AttachmentStrategy> | | |||
25 | #include <MimeTreeParser/BodyPartFormatter> | 25 | #include <MimeTreeParser/BodyPartFormatter> | ||
26 | #include <MimeTreeParser/BodyPartFormatterFactory> | 26 | #include <MimeTreeParser/BodyPartFormatterFactory> | ||
27 | 27 | | |||
28 | #include "messagepartthemes/default/defaultrenderer.h" | 28 | #include "messagepartthemes/default/defaultrenderer.h" | ||
29 | 29 | | |||
30 | using namespace MessageViewer; | 30 | using namespace MessageViewer; | ||
31 | 31 | | |||
32 | namespace MessageViewer { | 32 | namespace MessageViewer { | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | |||||
95 | } | 95 | } | ||
96 | 96 | | |||
97 | QString EmptySource::createMessageHeader(KMime::Message *message) | 97 | QString EmptySource::createMessageHeader(KMime::Message *message) | ||
98 | { | 98 | { | ||
99 | Q_UNUSED(message); | 99 | Q_UNUSED(message); | ||
100 | return QString(); //do nothing | 100 | return QString(); //do nothing | ||
101 | } | 101 | } | ||
102 | 102 | | |||
103 | const MimeTreeParser::AttachmentStrategy *EmptySource::attachmentStrategy() | 103 | const AttachmentStrategy *EmptySource::attachmentStrategy() | ||
104 | { | 104 | { | ||
105 | return MimeTreeParser::AttachmentStrategy::smart(); | 105 | return AttachmentStrategy::smart(); | ||
106 | } | 106 | } | ||
107 | 107 | | |||
108 | MimeTreeParser::HtmlWriter *EmptySource::htmlWriter() | 108 | MimeTreeParser::HtmlWriter *EmptySource::htmlWriter() | ||
109 | { | 109 | { | ||
110 | return nullptr; | 110 | return nullptr; | ||
111 | } | 111 | } | ||
112 | 112 | | |||
113 | CSSHelperBase *EmptySource::cssHelper() | 113 | CSSHelperBase *EmptySource::cssHelper() | ||
Show All 23 Lines | |||||
137 | 137 | | |||
138 | bool EmptySource::isPrinting() const | 138 | bool EmptySource::isPrinting() const | ||
139 | { | 139 | { | ||
140 | return false; | 140 | return false; | ||
141 | } | 141 | } | ||
142 | 142 | | |||
143 | void EmptySource::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, bool showOnlyOneMimePart) | 143 | void EmptySource::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, bool showOnlyOneMimePart) | ||
144 | { | 144 | { | ||
145 | DefaultRenderer(msgPart, cssHelper(), htmlWriter, showOnlyOneMimePart); | 145 | auto renderer = DefaultRenderer(cssHelper()); | ||
146 | renderer.setShowOnlyOneMimePart(showOnlyOneMimePart); | ||||
147 | renderer.setAttachmentStrategy(attachmentStrategy()); | ||||
148 | renderer.render(msgPart, htmlWriter); | ||||
146 | } | 149 | } |