Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
a7d069f2
Commit
a7d069f2
authored
Feb 09, 2021
by
Laurent Montel
Browse files
Remove duplicate code
parent
919451b1
Pipeline
#50348
passed with stage
in 41 minutes and 54 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
a7d069f2
cmake_minimum_required
(
VERSION 3.5 FATAL_ERROR
)
set
(
PIM_VERSION
"5.16.4
3
"
)
set
(
PIM_VERSION
"5.16.4
4
"
)
if
(
POLICY CMP0053
)
cmake_policy
(
SET CMP0053 NEW
)
...
...
messagecomposer/src/CMakeLists.txt
View file @
a7d069f2
...
...
@@ -150,6 +150,10 @@ set(messagecomposer_plugineditorgrammar_SRCS
plugineditorgrammar/plugineditorgrammarmanager.cpp
plugineditorgrammar/plugineditorgrammarcustomtoolsviewinterface.cpp
)
set
(
messagecomposer_plugineditorbase_SRCS
plugineditorbase/plugineditorbase.cpp
)
set
(
messagecomposer_sendlater_SRCS
sendlater/sendlaterinfo.cpp
sendlater/sendlaterjob.cpp
...
...
@@ -184,6 +188,7 @@ set( messagecomposer_src
${
messagecomposer_plugineditorcheckbeforesend_SRCS
}
${
messagecomposer_plugineditorgrammar_SRCS
}
${
messagecomposer_sendlater_SRCS
}
${
messagecomposer_plugineditorbase_SRCS
}
utils/util.cpp
settings/messagecomposersettings.cpp
)
...
...
@@ -302,6 +307,14 @@ ecm_generate_headers(MessageComposer_Camelplugineditorinit_HEADERS
RELATIVE plugineditorinit
)
ecm_generate_headers
(
MessageComposer_CamelPluginEditorBase_HEADERS
HEADER_NAMES
PluginEditorBase
REQUIRED_HEADERS MessageComposer_PluginEditorBase_HEADERS
PREFIX MessageComposer
RELATIVE plugineditorbase
)
ecm_generate_headers
(
MessageComposer_Camelplugineditorconverttext_HEADERS
HEADER_NAMES
PluginEditorConvertTextConfigureWidget
...
...
@@ -487,8 +500,8 @@ ecm_generate_pri_file(BASE_NAME MessageComposer
DEPS
"KMime MessageCore PimCommon Akonadi KIdentityManagement AkonadiMime Libkleo"
FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR
${
KDE_INSTALL_INCLUDEDIR_KF5
}
/MessageComposer
)
install
(
FILES
${
MessageComposer_CamelPluginEditorBase_HEADERS
}
${
MessageComposer_Camelsnippet_HEADERS
}
${
MessageComposer_Camelplugineditorconverttext_HEADERS
}
${
MessageComposer_Camelplugineditorinit_HEADERS
}
...
...
@@ -515,6 +528,7 @@ install(FILES
install
(
FILES
${
MessageComposer_HEADERS
}
${
MessageComposer_PluginEditorBase_HEADERS
}
${
MessageComposer_snippet_HEADERS
}
${
MessageComposer_plugineditorconverttext_HEADERS
}
${
MessageComposer_plugineditorinit_HEADERS
}
...
...
messagecomposer/src/plugineditorbase/plugineditorbase.cpp
0 → 100644
View file @
a7d069f2
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include
"plugineditorbase.h"
using
namespace
MessageComposer
;
class
MessageComposer
::
PluginEditorBasePrivate
{
public:
PluginEditorBasePrivate
()
{
}
bool
mIsEnabled
=
false
;
};
PluginEditorBase
::
PluginEditorBase
(
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
MessageComposer
::
PluginEditorBasePrivate
)
{
}
PluginEditorBase
::~
PluginEditorBase
()
{
delete
d
;
}
bool
PluginEditorBase
::
hasConfigureDialog
()
const
{
return
false
;
}
void
PluginEditorBase
::
showConfigureDialog
(
QWidget
*
parent
)
{
Q_UNUSED
(
parent
)
}
void
PluginEditorBase
::
emitConfigChanged
()
{
Q_EMIT
configChanged
();
}
QString
PluginEditorBase
::
description
()
const
{
return
{};
}
void
PluginEditorBase
::
setIsEnabled
(
bool
enabled
)
{
d
->
mIsEnabled
=
enabled
;
}
bool
PluginEditorBase
::
isEnabled
()
const
{
return
d
->
mIsEnabled
;
}
messagecomposer/src/plugineditorbase/plugineditorbase.h
0 → 100644
View file @
a7d069f2
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef PLUGINEDITORBASE_H
#define PLUGINEDITORBASE_H
#include
"messagecomposer_export.h"
#include
<QObject>
namespace
MessageComposer
{
class
PluginEditorBasePrivate
;
class
PluginEditorBaseInterface
;
/**
* @brief The PluginEditorBase class
* @author Laurent Montel <montel@kde.org>
*/
class
MESSAGECOMPOSER_EXPORT
PluginEditorBase
:
public
QObject
{
Q_OBJECT
public:
explicit
PluginEditorBase
(
QObject
*
parent
=
nullptr
);
~
PluginEditorBase
()
override
;
Q_REQUIRED_RESULT
virtual
bool
hasConfigureDialog
()
const
;
virtual
void
showConfigureDialog
(
QWidget
*
parent
=
nullptr
);
void
emitConfigChanged
();
Q_REQUIRED_RESULT
virtual
QString
description
()
const
;
void
setIsEnabled
(
bool
enabled
);
Q_REQUIRED_RESULT
bool
isEnabled
()
const
;
Q_SIGNALS:
void
configChanged
();
private:
PluginEditorBasePrivate
*
const
d
;
};
}
#endif // PLUGINEDITORBASE_H
messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesend.cpp
View file @
a7d069f2
...
...
@@ -8,53 +8,11 @@
using
namespace
MessageComposer
;
class
MessageComposer
::
PluginEditorCheckBeforeSendPrivate
{
public:
PluginEditorCheckBeforeSendPrivate
()
{
}
bool
mIsEnabled
=
false
;
};
PluginEditorCheckBeforeSend
::
PluginEditorCheckBeforeSend
(
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
MessageComposer
::
PluginEditorCheckBeforeSendPrivate
)
:
PluginEditorBase
(
parent
)
{
}
PluginEditorCheckBeforeSend
::~
PluginEditorCheckBeforeSend
()
{
delete
d
;
}
bool
PluginEditorCheckBeforeSend
::
hasConfigureDialog
()
const
{
return
false
;
}
void
PluginEditorCheckBeforeSend
::
showConfigureDialog
(
QWidget
*
parent
)
{
Q_UNUSED
(
parent
)
}
void
PluginEditorCheckBeforeSend
::
emitConfigChanged
()
{
Q_EMIT
configChanged
();
}
QString
PluginEditorCheckBeforeSend
::
description
()
const
{
return
{};
}
void
PluginEditorCheckBeforeSend
::
setIsEnabled
(
bool
enabled
)
{
d
->
mIsEnabled
=
enabled
;
}
bool
PluginEditorCheckBeforeSend
::
isEnabled
()
const
{
return
d
->
mIsEnabled
;
}
messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesend.h
View file @
a7d069f2
...
...
@@ -8,17 +8,16 @@
#define PLUGINEDITORCHECKBEFORESEND_H
#include
"messagecomposer_export.h"
#include
<
QObject
>
#include
<
MessageComposer/PluginEditorBase
>
namespace
MessageComposer
{
class
PluginEditorCheckBeforeSendPrivate
;
class
PluginEditorCheckBeforeSendInterface
;
/**
* @brief The PluginEditorCheckBeforeSend class
* @author Laurent Montel <montel@kde.org>
*/
class
MESSAGECOMPOSER_EXPORT
PluginEditorCheckBeforeSend
:
public
QObject
class
MESSAGECOMPOSER_EXPORT
PluginEditorCheckBeforeSend
:
public
PluginEditorBase
{
Q_OBJECT
public:
...
...
@@ -26,23 +25,6 @@ public:
~
PluginEditorCheckBeforeSend
()
override
;
virtual
PluginEditorCheckBeforeSendInterface
*
createInterface
(
QObject
*
parent
)
=
0
;
Q_REQUIRED_RESULT
virtual
bool
hasConfigureDialog
()
const
;
virtual
void
showConfigureDialog
(
QWidget
*
parent
=
nullptr
);
void
emitConfigChanged
();
Q_REQUIRED_RESULT
virtual
QString
description
()
const
;
void
setIsEnabled
(
bool
enabled
);
Q_REQUIRED_RESULT
bool
isEnabled
()
const
;
Q_SIGNALS:
void
configChanged
();
private:
PluginEditorCheckBeforeSendPrivate
*
const
d
;
};
}
#endif // PLUGINEDITORCHECKBEFORESEND_H
messagecomposer/src/plugineditorconverttext/plugineditorconverttext.h
View file @
a7d069f2
...
...
@@ -32,11 +32,12 @@ public:
void
emitConfigChanged
();
Q_REQUIRED_RESULT
virtual
QString
description
()
const
;
void
setIsEnabled
(
bool
enabled
);
Q_REQUIRED_RESULT
bool
isEnabled
()
const
;
Q_REQUIRED_RESULT
virtual
QString
description
()
const
;
Q_REQUIRED_RESULT
virtual
bool
canWorkOnHtml
()
const
;
Q_REQUIRED_RESULT
virtual
bool
hasStatusBarSupport
()
const
;
...
...
messagecomposer/src/plugineditorinit/plugineditorinit.cpp
View file @
a7d069f2
...
...
@@ -8,53 +8,11 @@
using
namespace
MessageComposer
;
class
MessageComposer
::
PluginEditorInitPrivate
{
public:
PluginEditorInitPrivate
()
{
}
bool
mIsEnabled
=
false
;
};
PluginEditorInit
::
PluginEditorInit
(
QObject
*
parent
)
:
QObject
(
parent
)
,
d
(
new
MessageComposer
::
PluginEditorInitPrivate
)
:
PluginEditorBase
(
parent
)
{
}
PluginEditorInit
::~
PluginEditorInit
()
{
delete
d
;
}
bool
PluginEditorInit
::
hasConfigureDialog
()
const
{
return
false
;
}
void
PluginEditorInit
::
showConfigureDialog
(
QWidget
*
parent
)
{
Q_UNUSED
(
parent
)
}
void
PluginEditorInit
::
emitConfigChanged
()
{
Q_EMIT
configChanged
();
}
QString
PluginEditorInit
::
description
()
const
{
return
{};
}
void
PluginEditorInit
::
setIsEnabled
(
bool
enabled
)
{
d
->
mIsEnabled
=
enabled
;
}
bool
PluginEditorInit
::
isEnabled
()
const
{
return
d
->
mIsEnabled
;
}
messagecomposer/src/plugineditorinit/plugineditorinit.h
View file @
a7d069f2
...
...
@@ -8,17 +8,17 @@
#define PLUGINEDITORINIT_H
#include
"messagecomposer_export.h"
#include
<MessageComposer/PluginEditorBase>
#include
<QObject>
namespace
MessageComposer
{
class
PluginEditorInitPrivate
;
class
PluginEditorInitInterface
;
/**
* @brief The PluginEditorInit class
* @author Laurent Montel <montel@kde.org>
*/
class
MESSAGECOMPOSER_EXPORT
PluginEditorInit
:
public
QObject
class
MESSAGECOMPOSER_EXPORT
PluginEditorInit
:
public
PluginEditorBase
{
Q_OBJECT
public:
...
...
@@ -26,23 +26,6 @@ public:
~
PluginEditorInit
()
override
;
virtual
PluginEditorInitInterface
*
createInterface
(
QObject
*
parent
)
=
0
;
Q_REQUIRED_RESULT
virtual
bool
hasConfigureDialog
()
const
;
virtual
void
showConfigureDialog
(
QWidget
*
parent
=
nullptr
);
void
emitConfigChanged
();
Q_REQUIRED_RESULT
virtual
QString
description
()
const
;
void
setIsEnabled
(
bool
enabled
);
Q_REQUIRED_RESULT
bool
isEnabled
()
const
;
Q_SIGNALS:
void
configChanged
();
private:
PluginEditorInitPrivate
*
const
d
;
};
}
#endif // PLUGINEDITORINIT_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment