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

Create plugins

parent 213bcfc3
Pipeline #200466 passed with stage
in 20 minutes and 35 seconds
......@@ -9,8 +9,6 @@ ecm_qt_declare_logging_category(akonadidatasetools HEADER akonadidatasetools_deb
)
target_sources(akonadidatasetools PRIVATE
akonadidatabasetoolsplugin.cpp
akonadidatabasetoolsplugin.h
akonadidatabasetoolsplugininterface.cpp
akonadidatabasetoolsplugininterface.h
)
......@@ -30,6 +28,18 @@ set_target_properties(akonadidatasetools
PROPERTIES OUTPUT_NAME akonadidatasetools VERSION ${KDEPIMADDONS_LIB_VERSION} SOVERSION ${KDEPIMADDONS_LIB_SOVERSION}
)
kcoreaddons_add_plugin(kmail_akonadidatabasetoolplugin INSTALL_NAMESPACE pim${QT_MAJOR_VERSION}/kmail/mainview)
target_sources(kmail_akonadidatabasetoolplugin PRIVATE
akonadidatabasetoolsplugin.cpp
akonadidatabasetoolsplugin.h
)
target_link_libraries(kmail_akonadidatabasetoolplugin
KF5::PimCommon KF5::PimCommonAkonadi KF5::XmlGui KF5::Libkdepim KF5::I18n akonadidatasetools
)
install(TARGETS akonadidatasetools ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
if(BUILD_TESTING)
add_subdirectory(autotests)
add_subdirectory(tests)
......
......@@ -19,11 +19,28 @@ AkonadiDatabaseToolsPluginInterface::~AkonadiDatabaseToolsPluginInterface() = de
void AkonadiDatabaseToolsPluginInterface::createAction(KActionCollection *ac)
{
auto action = new QAction(i18n("&Akonadi Vaccum..."), this);
ac->addAction(QStringLiteral("akonadivaccum"), action);
connect(action, &QAction::triggered, this, &AkonadiDatabaseToolsPluginInterface::slotActivated);
PimCommon::ActionType type(action, PimCommon::ActionType::Tools);
addActionType(type);
{
auto action = new QAction(i18n("&Akonadi Vaccum..."), this);
ac->addAction(QStringLiteral("akonadivaccum"), action);
connect(action, &QAction::triggered, this, [this]() {
mTool = AkonadiDatabaseTool::Vaccum;
slotActivated();
});
PimCommon::ActionType type(action, PimCommon::ActionType::Tools);
addActionType(type);
}
{
auto action = new QAction(i18n("&Akonadi Fsck..."), this);
ac->addAction(QStringLiteral("akonadifsck"), action);
connect(action, &QAction::triggered, this, [this]() {
mTool = AkonadiDatabaseTool::Fsck;
slotActivated();
});
PimCommon::ActionType type(action, PimCommon::ActionType::Tools);
addActionType(type);
}
}
void AkonadiDatabaseToolsPluginInterface::slotActivated()
......@@ -35,6 +52,7 @@ void AkonadiDatabaseToolsPluginInterface::exec()
{
switch (mTool) {
case Unknown:
qCWarning(AKONADIDATABASETOOLS_LOG) << "mTool is unknown it's a bug! ";
break;
case Vaccum:
break;
......
......@@ -3,7 +3,7 @@
"Description": "This plugin allows you to manage Akonadi database.",
"EnabledByDefault": "false",
"Id": "kmailakonadidatabasetool",
"Name": "Antispam",
"Name": "Akonadi Database Mananger",
"Version": "1.0"
}
}
Supports Markdown
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