Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit fd79d3a4 authored by Laurent Montel's avatar Laurent Montel 😁

Use new api

parent 8e59e8a7
......@@ -20,6 +20,7 @@
#include "inserttemplatecommandplugineditorinterface.h"
#include <KPIMTextEdit/RichTextEditor>
#include <TemplateParser/TemplatesInsertCommandAction>
#include <MessageComposer/PluginEditorConverterInitialData>
#include <KPIMTextEdit/RichTextComposer>
#include <KLocalizedString>
#include <KActionCollection>
......@@ -82,14 +83,14 @@ bool InsertTemplateCommandPluginEditorInterface::reformatText()
return false;
}
void InsertTemplateCommandPluginEditorInterface::setMessage(const KMime::Message::Ptr &msg)
void InsertTemplateCommandPluginEditorInterface::setInitialData(const MessageComposer::PluginEditorConverterInitialData &data)
{
//We need to understand how we can find a new message
MessageComposer::PluginEditorConvertTextInterface::setMessage(msg);
MessageComposer::PluginEditorConvertTextInterface::setInitialData(data);
TemplateParser::TemplatesCommandMenu::MenuTypes type;
type |= TemplateParser::TemplatesCommandMenu::ReplyForwardMessage;
type |= TemplateParser::TemplatesCommandMenu::CurrentMessage;
if (!data.newMessage()) {
type |= TemplateParser::TemplatesCommandMenu::ReplyForwardMessage;
}
mCommandAction->setType(type);
mToolButton->setMenu(mCommandAction->menu());
}
......@@ -35,7 +35,7 @@ public:
void createAction(KActionCollection *ac) override;
bool convertTextToFormat(MessageComposer::TextPart *textPart) override;
bool reformatText() override;
void setMessage(const KMime::Message::Ptr &) override;
void setInitialData(const MessageComposer::PluginEditorConverterInitialData &data) override;
private:
void slotInsertCommand(const QString &cmd, int adjustCursor);
......@@ -45,6 +45,7 @@ private:
int mAdjustCursor = 0;
TemplateParser::TemplatesInsertCommandAction *mCommandAction = nullptr;
QToolButton *mToolButton = nullptr;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment