[pim/kdepim-addons] /: Adapt to API changes for body part plugins
Volker Krause <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit f8732dc5d20e9885ed2e6e2bb481204274b1e5c8 by Volker Krause.
Committed on 17/08/2026 at 20:17.
Pushed by vkrause into branch 'master'.
Adapt to API changes for body part plugins
This should address the LSAN issues in the render tests here.
M +1 -1 CMakeLists.txt
M +2 -2 plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
M +6 -6 plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
M +2 -2 plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
M +2 -2 plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp
M +4 -4 plugins/messageviewer/bodypartformatter/itinerary/itinerary_plugin.cpp
M +2 -2 plugins/messageviewer/bodypartformatter/markdown/textmarkdownplugin.cpp
M +4 -4 plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp
M +2 -2 plugins/messageviewer/bodypartformatter/pkpass/pkpass_plugin.cpp
M +2 -2 plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
https://invent.kde.org/pim/kdepim-addons/-/commit/f8732dc5d20e9885ed2e6e2bb481204274b1e5c8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2fec383b6..38045e25e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,7 +194,7 @@ set(LIBKLEO_LIB_VERSION "6.8.40")
set(AKONADI_LIB_VERSION "6.8.40")
set(INCIDENCEEDITOR_LIB_VERSION "6.8.40")
set(KTNEF_LIB_VERSION "6.8.40")
-set(MESSAGELIB_LIB_VERSION "6.8.40")
+set(MESSAGELIB_LIB_VERSION "6.8.41")
set(AKONADICALENDAR_LIB_VERSION "6.8.41")
set(CALENDAR_UTILS_VERSION "6.8.40")
set(KPIMTEXTEDIT_LIB_VERSION "6.8.40")
diff --git a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
index 457918c65..1cf8d174b 100644
--- a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
+++ b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
@@ -1426,10 +1426,10 @@ class Plugin : public QObject, public MessageViewer::MessagePartRenderPlugin
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "text_calendar.json")
public:
- MessageViewer::MessagePartRendererBase *renderer(int idx) override
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int idx) override
{
if (idx < 2) {
- return new Formatter();
+ return std::make_unique<Formatter>();
} else {
return nullptr;
}
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
index e0e3f76a5..92fb1dd79 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
@@ -20,27 +20,27 @@ enum Index {
};
}
-const MimeTreeParser::Interface::BodyPartFormatter *ApplicationGnuPGWKSPlugin::bodyPartFormatter(int idx) const
+std::unique_ptr<const MimeTreeParser::Interface::BodyPartFormatter> ApplicationGnuPGWKSPlugin::bodyPartFormatter(int idx) const
{
switch (idx) {
case multipart_mixed:
case application_vnd_gnupg_keys:
- return new ApplicationGnuPGWKSFormatter();
+ return std::make_unique<ApplicationGnuPGWKSFormatter>();
case application_pgp_keys:
- return new ApplicationPGPKeyFormatter();
+ return std::make_unique<ApplicationPGPKeyFormatter>();
default:
return nullptr;
}
}
-MessageViewer::MessagePartRendererBase *ApplicationGnuPGWKSPlugin::renderer(int idx)
+std::unique_ptr<MessageViewer::MessagePartRendererBase> ApplicationGnuPGWKSPlugin::renderer(int idx)
{
switch (idx) {
case multipart_mixed:
case application_vnd_gnupg_keys:
- return new ApplicationGnuPGWKSFormatter();
+ return std::make_unique<ApplicationGnuPGWKSFormatter>();
case application_pgp_keys:
- return new ApplicationPGPKeyFormatter();
+ return std::make_unique<ApplicationPGPKeyFormatter>();
default:
return nullptr;
}
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
index ccc522aaa..af2173d94 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
@@ -18,7 +18,7 @@ class ApplicationGnuPGWKSPlugin : public QObject, public MimeTreeParser::Interfa
public:
ApplicationGnuPGWKSPlugin() = default;
- const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const override;
- MessageViewer::MessagePartRendererBase *renderer(int index) override;
+ [[nodiscard]] std::unique_ptr<const MimeTreeParser::Interface::BodyPartFormatter> bodyPartFormatter(int idx) const override;
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int index) override;
const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int idx) const override;
};
diff --git a/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp b/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp
index 0e37e96dd..4e21bb5dd 100644
--- a/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp
@@ -81,10 +81,10 @@ class Plugin : public QObject, public MessageViewer::MessagePartRenderPlugin
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "texthighlighterplugin.json")
public:
- MessageViewer::MessagePartRendererBase *renderer(int index) override
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int index) override
{
if (index == 0) {
- return new Formatter();
+ return std::make_unique<Formatter>();
}
return nullptr;
}
diff --git a/plugins/messageviewer/bodypartformatter/itinerary/itinerary_plugin.cpp b/plugins/messageviewer/bodypartformatter/itinerary/itinerary_plugin.cpp
index 805235b86..1fdca7475 100644
--- a/plugins/messageviewer/bodypartformatter/itinerary/itinerary_plugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/itinerary/itinerary_plugin.cpp
@@ -27,18 +27,18 @@ public:
{
}
- [[nodiscard]] const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const override
+ [[nodiscard]] std::unique_ptr<const MimeTreeParser::Interface::BodyPartFormatter> bodyPartFormatter(int idx) const override
{
if (idx < 3) {
- return new ItineraryProcessor();
+ return std::make_unique<ItineraryProcessor>();
}
return nullptr;
}
- MessageViewer::MessagePartRendererBase *renderer(int idx) override
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int idx) override
{
if (idx == 0) {
- auto renderer = new ItineraryRenderer();
+ auto renderer = std::make_unique<ItineraryRenderer>();
renderer->setKDEConnectHandler(m_kdeConnect);
return renderer;
}
diff --git a/plugins/messageviewer/bodypartformatter/markdown/textmarkdownplugin.cpp b/plugins/messageviewer/bodypartformatter/markdown/textmarkdownplugin.cpp
index dcd730f57..812270bbc 100644
--- a/plugins/messageviewer/bodypartformatter/markdown/textmarkdownplugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/markdown/textmarkdownplugin.cpp
@@ -71,10 +71,10 @@ class Plugin : public QObject, public MessageViewer::MessagePartRenderPlugin
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "textmarkdownplugin.json")
public:
- MessageViewer::MessagePartRendererBase *renderer(int index) override
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int index) override
{
if (index == 0) {
- return new Formatter();
+ return std::make_unique<Formatter>();
}
return nullptr;
}
diff --git a/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp b/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp
index f17496ce4..5a6eb0fc7 100644
--- a/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp
+++ b/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp
@@ -135,14 +135,14 @@ class Plugin : public QObject, public MimeTreeParser::Interface::BodyPartFormatt
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "application_ms-tnef.json")
public:
- [[nodiscard]] const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const override
+ [[nodiscard]] std::unique_ptr<const MimeTreeParser::Interface::BodyPartFormatter> bodyPartFormatter(int idx) const override
{
- return idx < 2 ? new TNEFProcessor() : nullptr;
+ return idx < 2 ? std::make_unique<TNEFProcessor>() : nullptr;
}
- MessageViewer::MessagePartRendererBase *renderer(int index) override
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int index) override
{
- return index == 0 ? new Formatter() : nullptr;
+ return index == 0 ? std::make_unique<Formatter>() : nullptr;
}
};
}
diff --git a/plugins/messageviewer/bodypartformatter/pkpass/pkpass_plugin.cpp b/plugins/messageviewer/bodypartformatter/pkpass/pkpass_plugin.cpp
index b1425f856..d924c0da6 100644
--- a/plugins/messageviewer/bodypartformatter/pkpass/pkpass_plugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/pkpass/pkpass_plugin.cpp
@@ -180,9 +180,9 @@ public:
{
}
- MessageViewer::MessagePartRendererBase *renderer(int index) override
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int index) override
{
- return index == 0 ? new Formatter() : nullptr;
+ return index == 0 ? std::make_unique<Formatter>() : nullptr;
}
};
}
diff --git a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
index b7dfe8dbf..b786a61e0 100644
--- a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
+++ b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
@@ -290,9 +290,9 @@ class Plugin : public QObject, public MessageViewer::MessagePartRenderPlugin
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "text_vcard.json")
public:
- MessageViewer::MessagePartRendererBase *renderer(int index) override
+ [[nodiscard]] std::unique_ptr<MessageViewer::MessagePartRendererBase> renderer(int index) override
{
- return validIndex(index) ? new Formatter() : nullptr;
+ return validIndex(index) ? std::make_unique<Formatter>() : nullptr;
}
[[nodiscard]] const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int idx) const override