Skip to content
GitLab
Menu
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
58dd7d58
Commit
58dd7d58
authored
Jun 28, 2021
by
Laurent Montel
😁
Browse files
Improve plugin
parent
890724f2
Changes
6
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
58dd7d58
cmake_minimum_required
(
VERSION 3.16 FATAL_ERROR
)
set
(
PIM_VERSION
"5.17.5
2
"
)
set
(
PIM_VERSION
"5.17.5
3
"
)
project
(
Messagelib VERSION
${
PIM_VERSION
}
)
...
...
messageviewer/src/messageviewercheckbeforedeletingplugins/messageviewercheckbeforedeletinginterface.cpp
View file @
58dd7d58
...
...
@@ -5,6 +5,7 @@
*/
#include "messageviewercheckbeforedeletinginterface.h"
#include "messageviewercheckbeforedeletingparameters.h"
using
namespace
MessageViewer
;
...
...
@@ -15,6 +16,7 @@ public:
{
}
MessageViewer
::
MessageViewerCheckBeforeDeletingParameters
parameters
;
QWidget
*
mParentWidget
=
nullptr
;
};
...
...
@@ -43,3 +45,13 @@ void MessageViewerCheckBeforeDeletingInterface::reloadConfig()
{
// Reimplement it
}
void
MessageViewerCheckBeforeDeletingInterface
::
setParameters
(
const
MessageViewer
::
MessageViewerCheckBeforeDeletingParameters
&
params
)
{
d
->
parameters
=
params
;
}
MessageViewer
::
MessageViewerCheckBeforeDeletingParameters
MessageViewerCheckBeforeDeletingInterface
::
parameters
()
const
{
return
d
->
parameters
;
}
messageviewer/src/messageviewercheckbeforedeletingplugins/messageviewercheckbeforedeletinginterface.h
View file @
58dd7d58
...
...
@@ -11,6 +11,7 @@
namespace
MessageViewer
{
class
MessageViewerCheckBeforeDeletingParameters
;
class
MessageViewerCheckBeforeDeletingInterfacePrivate
;
/**
* @brief The MessageViewerCheckBeforeDeletingInterface class
...
...
@@ -26,7 +27,10 @@ public:
void
setParentWidget
(
QWidget
*
parent
);
Q_REQUIRED_RESULT
QWidget
*
parentWidget
()
const
;
// TODO add virtual method
virtual
bool
exec
()
=
0
;
void
setParameters
(
const
MessageViewer
::
MessageViewerCheckBeforeDeletingParameters
&
params
);
Q_REQUIRED_RESULT
MessageViewer
::
MessageViewerCheckBeforeDeletingParameters
parameters
()
const
;
public
Q_SLOTS
:
virtual
void
reloadConfig
();
...
...
messageviewer/src/messageviewercheckbeforedeletingplugins/messageviewercheckbeforedeletingparameters.cpp
View file @
58dd7d58
...
...
@@ -13,6 +13,7 @@ public:
MessageViewerCheckBeforeDeletingParametersPrivate
()
{
}
MessageViewerCheckBeforeDeletingParameters
::
DeleteType
mType
=
MessageViewerCheckBeforeDeletingParameters
::
Unknown
;
};
MessageViewerCheckBeforeDeletingParameters
::
MessageViewerCheckBeforeDeletingParameters
()
...
...
@@ -20,6 +21,35 @@ MessageViewerCheckBeforeDeletingParameters::MessageViewerCheckBeforeDeletingPara
{
}
MessageViewerCheckBeforeDeletingParameters
::
MessageViewerCheckBeforeDeletingParameters
(
const
MessageViewerCheckBeforeDeletingParameters
&
other
)
:
d
(
new
MessageViewer
::
MessageViewerCheckBeforeDeletingParametersPrivate
)
{
(
*
this
)
=
other
;
}
MessageViewerCheckBeforeDeletingParameters
::~
MessageViewerCheckBeforeDeletingParameters
()
{
}
MessageViewerCheckBeforeDeletingParameters
::
DeleteType
MessageViewerCheckBeforeDeletingParameters
::
deleteType
()
const
{
return
d
->
mType
;
}
void
MessageViewerCheckBeforeDeletingParameters
::
setDeleteType
(
DeleteType
type
)
{
d
->
mType
=
type
;
}
MessageViewerCheckBeforeDeletingParameters
&
MessageViewerCheckBeforeDeletingParameters
::
operator
=
(
const
MessageViewerCheckBeforeDeletingParameters
&
other
)
{
if
(
this
!=
&
other
)
{
d
->
mType
=
other
.
deleteType
();
}
return
*
this
;
}
bool
MessageViewerCheckBeforeDeletingParameters
::
operator
==
(
const
MessageViewerCheckBeforeDeletingParameters
&
other
)
const
{
return
(
d
->
mType
==
other
.
deleteType
());
}
messageviewer/src/messageviewercheckbeforedeletingplugins/messageviewercheckbeforedeletingparameters.h
View file @
58dd7d58
...
...
@@ -6,6 +6,7 @@
#pragma once
#include "messageviewer_export.h"
#include <QString>
namespace
MessageViewer
{
class
MessageViewerCheckBeforeDeletingParametersPrivate
;
...
...
@@ -13,8 +14,21 @@ class MESSAGEVIEWER_EXPORT MessageViewerCheckBeforeDeletingParameters
{
public:
MessageViewerCheckBeforeDeletingParameters
();
MessageViewerCheckBeforeDeletingParameters
(
const
MessageViewerCheckBeforeDeletingParameters
&
other
);
~
MessageViewerCheckBeforeDeletingParameters
();
enum
DeleteType
{
Unknown
=
0
,
MoveToTrash
=
1
,
Delete
=
2
,
};
Q_REQUIRED_RESULT
MessageViewerCheckBeforeDeletingParameters
::
DeleteType
deleteType
()
const
;
void
setDeleteType
(
MessageViewerCheckBeforeDeletingParameters
::
DeleteType
type
);
MessageViewerCheckBeforeDeletingParameters
&
operator
=
(
const
MessageViewerCheckBeforeDeletingParameters
&
other
);
Q_REQUIRED_RESULT
bool
operator
==
(
const
MessageViewerCheckBeforeDeletingParameters
&
other
)
const
;
private:
MessageViewerCheckBeforeDeletingParametersPrivate
*
const
d
;
};
...
...
messageviewer/src/messageviewercheckbeforedeletingplugins/messageviewercheckbeforedeletingpluginmanager.cpp
View file @
58dd7d58
...
...
@@ -37,13 +37,13 @@ public:
{
}
QVector
<
MessageViewer
::
MessageViewerCheckBeforeDeletingPlugin
*>
pluginsList
()
const
;
QVector
<
PimCommon
::
PluginUtilData
>
pluginDataList
()
const
;
Q_REQUIRED_RESULT
QVector
<
MessageViewer
::
MessageViewerCheckBeforeDeletingPlugin
*>
pluginsList
()
const
;
Q_REQUIRED_RESULT
QVector
<
PimCommon
::
PluginUtilData
>
pluginDataList
()
const
;
void
initializePluginList
();
void
loadPlugin
(
CheckBeforeDeletingPluginInfo
*
item
);
QString
configGroupName
()
const
;
QString
configPrefixSettingKey
()
const
;
MessageViewerCheckBeforeDeletingPlugin
*
pluginFromIdentifier
(
const
QString
&
id
);
Q_REQUIRED_RESULT
QString
configGroupName
()
const
;
Q_REQUIRED_RESULT
QString
configPrefixSettingKey
()
const
;
Q_REQUIRED_RESULT
MessageViewerCheckBeforeDeletingPlugin
*
pluginFromIdentifier
(
const
QString
&
id
);
private:
QVector
<
PimCommon
::
PluginUtilData
>
mPluginDataList
;
...
...
@@ -77,7 +77,6 @@ QString MessageViewerCheckBeforeDeletingPluginManagerPrivate::configPrefixSettin
void
MessageViewerCheckBeforeDeletingPluginManagerPrivate
::
initializePluginList
()
{
const
QVector
<
KPluginMetaData
>
plugins
=
KPluginLoader
::
findPlugins
(
QStringLiteral
(
"messageviewer/checkbeforedeleting"
));
QVectorIterator
<
KPluginMetaData
>
i
(
plugins
);
i
.
toBack
();
const
QPair
<
QStringList
,
QStringList
>
pair
=
PimCommon
::
PluginUtil
::
loadPluginSetting
(
configGroupName
(),
configPrefixSettingKey
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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