Commit 9ab45d16 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Clean up

parent 0dcfea32
......@@ -29,6 +29,6 @@ ConvertSnippetVariableMenuTest::ConvertSnippetVariableMenuTest(QObject *parent)
void ConvertSnippetVariableMenuTest::shouldHaveDefaultValues()
{
MessageComposer::ConvertSnippetVariableMenu w(nullptr);
MessageComposer::ConvertSnippetVariableMenu w(true, nullptr);
QVERIFY(w.menu());
}
......@@ -24,13 +24,6 @@
#include <QTime>
#include <QLocale>
using namespace MessageComposer;
ConvertSnippetVariableMenu::ConvertSnippetVariableMenu(QWidget *parentWidget, QObject *parent)
: QObject(parent)
, mParentWidget(parentWidget)
{
initializeMenu(false);
}
ConvertSnippetVariableMenu::ConvertSnippetVariableMenu(bool onlyMenuForCustomizeAttachmentFileName, QWidget *parentWidget, QObject *parent)
: QObject(parent)
, mParentWidget(parentWidget)
......@@ -164,12 +157,14 @@ void ConvertSnippetVariableMenu::initializeMenu(bool onlyMenuForCustomizeAttachm
});
mMenu->addMenu(dateTimeMenuVariable);
QMenu *miscVariable = new QMenu(i18n("Misc"), mMenu);
miscVariable->addAction(i18n("Subject"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::FullSubject);
});
//Add more variables!
mMenu->addMenu(miscVariable);
if (!onlyMenuForCustomizeAttachmentFileName) {
QMenu *miscVariable = new QMenu(i18n("Misc"), mMenu);
miscVariable->addAction(i18n("Subject"), this, [this]() {
Q_EMIT insertVariable(MessageComposer::ConvertSnippetVariablesUtil::FullSubject);
});
//Add more variables!
mMenu->addMenu(miscVariable);
}
}
QMenu *ConvertSnippetVariableMenu::menu() const
......
......@@ -33,7 +33,6 @@ class MESSAGECOMPOSER_EXPORT ConvertSnippetVariableMenu : public QObject
{
Q_OBJECT
public:
explicit ConvertSnippetVariableMenu(QWidget *parentWidget, QObject *parent = nullptr);
explicit ConvertSnippetVariableMenu(bool onlyMenuForCustomizeAttachmentFileName, QWidget *parentWidget, QObject *parent = nullptr);
~ConvertSnippetVariableMenu();
QMenu *menu() const;
......
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