Commit a6621092 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Reduce duplicate code

parent bd407c4e
Pipeline #62666 passed with stage
in 40 minutes and 4 seconds
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "5.17.49")
set(PIM_VERSION "5.17.50")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -127,19 +127,16 @@ set(messagecomposer_plugineditorcheckbeforesend_SRCS
plugineditorcheckbeforesend/plugineditorcheckbeforesend.cpp
plugineditorcheckbeforesend/plugineditorcheckbeforesendinterface.cpp
plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp
plugineditorcheckbeforesend/plugineditorcheckbeforesendconfigurewidget.cpp
plugineditorcheckbeforesend/plugineditorcheckbeforesendparams.cpp
)
set(messagecomposer_plugineditorinit_SRCS
plugineditorinit/plugineditorinitconfigurewidget.cpp
plugineditorinit/plugineditorinit.cpp
plugineditorinit/plugineditorinitmanager.cpp
plugineditorinit/plugineditorinitinterface.cpp
)
set(messagecomposer_plugineditorconverttext_SRCS
plugineditorconverttext/plugineditorconverttextconfigurewidget.cpp
plugineditorconverttext/plugineditorconverttext.cpp
plugineditorconverttext/plugineditorconverttextmanager.cpp
plugineditorconverttext/plugineditorconverttextinterface.cpp
......@@ -153,6 +150,7 @@ set(messagecomposer_plugineditorgrammar_SRCS
set(messagecomposer_plugineditorbase_SRCS
plugineditorbase/plugineditorbase.cpp
plugineditorbase/plugineditorconfigurebasewidget.cpp
)
set(messagecomposer_sendlater_SRCS
sendlater/sendlaterinfo.cpp
......@@ -298,7 +296,6 @@ ecm_generate_headers(MessageComposer_Camelplugineditor_HEADERS
ecm_generate_headers(MessageComposer_Camelplugineditorinit_HEADERS
HEADER_NAMES
PluginEditorInitConfigureWidget
PluginEditorInit
PluginEditorInitManager
PluginEditorInitInterface
......@@ -310,6 +307,7 @@ ecm_generate_headers(MessageComposer_Camelplugineditorinit_HEADERS
ecm_generate_headers(MessageComposer_CamelPluginEditorBase_HEADERS
HEADER_NAMES
PluginEditorBase
PluginEditorConfigureBaseWidget
REQUIRED_HEADERS MessageComposer_PluginEditorBase_HEADERS
PREFIX MessageComposer
RELATIVE plugineditorbase
......@@ -317,7 +315,6 @@ ecm_generate_headers(MessageComposer_CamelPluginEditorBase_HEADERS
ecm_generate_headers(MessageComposer_Camelplugineditorconverttext_HEADERS
HEADER_NAMES
PluginEditorConvertTextConfigureWidget
PluginEditorConvertText
PluginEditorConvertTextManager
PluginEditorConvertTextInterface
......@@ -343,7 +340,6 @@ ecm_generate_headers(MessageComposer_Camelplugineditorcheckbeforesend_HEADERS
PluginEditorCheckBeforeSend
PluginEditorCheckBeforeSendInterface
PluginEditorCheckBeforeSendManager
PluginEditorCheckBeforeSendConfigureWidget
PluginEditorCheckBeforeSendParams
REQUIRED_HEADERS MessageComposer_plugineditorcheckbeforesend_HEADERS
PREFIX MessageComposer
......
......@@ -4,20 +4,20 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "plugineditorcheckbeforesendconfigurewidget.h"
#include "plugineditorconfigurebasewidget.h"
using namespace MessageComposer;
PluginEditorCheckBeforeSendConfigureWidget::PluginEditorCheckBeforeSendConfigureWidget(QWidget *parent)
PluginEditorConfigureBaseWidget::PluginEditorConfigureBaseWidget(QWidget *parent)
: QWidget(parent)
{
}
PluginEditorCheckBeforeSendConfigureWidget::~PluginEditorCheckBeforeSendConfigureWidget()
PluginEditorConfigureBaseWidget::~PluginEditorConfigureBaseWidget()
{
}
QString PluginEditorCheckBeforeSendConfigureWidget::helpAnchor() const
QString PluginEditorConfigureBaseWidget::helpAnchor() const
{
return QString();
}
......@@ -12,15 +12,15 @@
namespace MessageComposer
{
/**
* @brief The PluginEditorCheckBeforeSendConfigureWidget class
* @brief The PluginEditorConfigureBaseWidget class
* @author Laurent Montel <montel@kde.org>
*/
class MESSAGECOMPOSER_EXPORT PluginEditorCheckBeforeSendConfigureWidget : public QWidget
class MESSAGECOMPOSER_EXPORT PluginEditorConfigureBaseWidget : public QWidget
{
Q_OBJECT
public:
explicit PluginEditorCheckBeforeSendConfigureWidget(QWidget *parent = nullptr);
~PluginEditorCheckBeforeSendConfigureWidget() override;
explicit PluginEditorConfigureBaseWidget(QWidget *parent = nullptr);
~PluginEditorConfigureBaseWidget() override;
virtual void loadSettings() = 0;
virtual void saveSettings() = 0;
......
/*
SPDX-FileCopyrightText: 2018-2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "plugineditorconverttextconfigurewidget.h"
using namespace MessageComposer;
PluginEditorConvertTextConfigureWidget::PluginEditorConvertTextConfigureWidget(QWidget *parent)
: QWidget(parent)
{
}
PluginEditorConvertTextConfigureWidget::~PluginEditorConvertTextConfigureWidget()
{
}
QString PluginEditorConvertTextConfigureWidget::helpAnchor() const
{
return QString();
}
/*
SPDX-FileCopyrightText: 2018-2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include "messagecomposer_export.h"
#include <QWidget>
namespace MessageComposer
{
/**
* @brief The PluginEditorConvertTextConfigureWidget class
* @author Laurent Montel <montel@kde.org>
*/
class MESSAGECOMPOSER_EXPORT PluginEditorConvertTextConfigureWidget : public QWidget
{
Q_OBJECT
public:
explicit PluginEditorConvertTextConfigureWidget(QWidget *parent = nullptr);
~PluginEditorConvertTextConfigureWidget() override;
virtual void loadSettings() = 0;
virtual void saveSettings() = 0;
virtual void resetSettings() = 0;
virtual QString helpAnchor() const;
Q_SIGNALS:
void configureChanged();
};
}
/*
SPDX-FileCopyrightText: 2017-2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "plugineditorinitconfigurewidget.h"
using namespace MessageComposer;
PluginEditorInitConfigureWidget::PluginEditorInitConfigureWidget(QWidget *parent)
: QWidget(parent)
{
}
PluginEditorInitConfigureWidget::~PluginEditorInitConfigureWidget()
{
}
QString PluginEditorInitConfigureWidget::helpAnchor() const
{
return QString();
}
/*
SPDX-FileCopyrightText: 2017-2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include "messagecomposer_export.h"
#include <QWidget>
namespace MessageComposer
{
/**
* @brief The PluginEditorInitConfigureWidget class
* @author Laurent Montel <montel@kde.org>
*/
class MESSAGECOMPOSER_EXPORT PluginEditorInitConfigureWidget : public QWidget
{
Q_OBJECT
public:
explicit PluginEditorInitConfigureWidget(QWidget *parent = nullptr);
~PluginEditorInitConfigureWidget() override;
virtual void loadSettings() = 0;
virtual void saveSettings() = 0;
virtual void resetSettings() = 0;
Q_REQUIRED_RESULT virtual QString helpAnchor() const;
Q_SIGNALS:
void configureChanged();
};
}
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