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

Remove unused plugins

parent 40b577a2
Pipeline #153148 passed with stage
in 19 minutes and 6 seconds
......@@ -5,7 +5,6 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kmail_plugins\")
add_subdirectory(antispamplugin)
add_subdirectory(antivirusplugin)
add_subdirectory(common/avscripts)
add_subdirectory(logactivitiesplugin)
add_subdirectory(expertplugin)
add_subdirectory(mailmergeplugin)
install(FILES common/kmail.antispamrc common/kmail.antivirusrc DESTINATION ${KDE_INSTALL_CONFDIR})
# SPDX-FileCopyrightText: 2015-2022 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
kcoreaddons_add_plugin(kmail_logactivitiesplugin INSTALL_NAMESPACE kmail/mainview)
target_sources(kmail_logactivitiesplugin PRIVATE
logactivitiesplugin.cpp
logactivitiesplugininterface.cpp
logactivitiesplugin.h
logactivitiesplugininterface.h
)
target_link_libraries(kmail_logactivitiesplugin
KF5::PimCommon KF5::PimCommonAkonadi KF5::XmlGui KF5::Libkdepim KF5::I18n
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(kmail_logactivitiesplugin PROPERTIES UNITY_BUILD ON)
endif()
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
# SPDX-FileCopyrightText: 2015-2022 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
macro(add_kmail_logactivitiesplugin_unittest _source _additional)
set( _test ${_source} ${_additional})
get_filename_component(_name ${_source} NAME_WE)
add_executable( ${_name} ${_test} )
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(kmail_logactivitiesplugin-${_name})
target_link_libraries( ${_name} KF5::PimCommon Qt${QT_MAJOR_VERSION}::Test KF5::XmlGui KF5::Completion KF5::PimCommonAkonadi KF5::Libkdepim KF5::I18n)
endmacro ()
add_kmail_logactivitiesplugin_unittest(logactivitiesplugininterfacetest.cpp "../logactivitiesplugininterface.cpp")
/*
SPDX-FileCopyrightText: 2017-2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "logactivitiesplugininterfacetest.h"
#include "../logactivitiesplugininterface.h"
#include <KActionCollection>
#include <QSignalSpy>
#include <QTest>
LogActivitiesPluginInterfaceTest::LogActivitiesPluginInterfaceTest(QObject *parent)
: QObject(parent)
{
}
LogActivitiesPluginInterfaceTest::~LogActivitiesPluginInterfaceTest() = default;
void LogActivitiesPluginInterfaceTest::shouldHaveDefaultValue()
{
LogActivitiesPluginInterface interface;
interface.createAction(new KActionCollection(this));
QVERIFY(!interface.parentWidget());
QCOMPARE(interface.actionTypes().count(), 1);
QVERIFY(interface.actionTypes().at(0).action());
}
void LogActivitiesPluginInterfaceTest::shouldCreateAction()
{
LogActivitiesPluginInterface interface;
interface.createAction(new KActionCollection(this));
QVERIFY(interface.actionTypes().at(0).action());
}
void LogActivitiesPluginInterfaceTest::shouldEmitActivatedSignal()
{
LogActivitiesPluginInterface interface;
interface.createAction(new KActionCollection(this));
QSignalSpy spy1(&interface, &PimCommon::AbstractGenericPluginInterface::emitPluginActivated);
interface.actionTypes().at(0).action()->trigger();
QCOMPARE(spy1.count(), 1);
}
QTEST_MAIN(LogActivitiesPluginInterfaceTest)
/*
SPDX-FileCopyrightText: 2017-2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
class LogActivitiesPluginInterfaceTest : public QObject
{
Q_OBJECT
public:
explicit LogActivitiesPluginInterfaceTest(QObject *parent = nullptr);
~LogActivitiesPluginInterfaceTest() override;
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldCreateAction();
void shouldEmitActivatedSignal();
};
{
"KPlugin": {
"Description": "This plugin allows you to log KMail activities.",
"Description[ar]": "تتيح لك هذه الملحقة تسجيل أنشطة «بريدك».",
"Description[az]": "Bu əlavə, KMail-in işini jurnala qeyd etməyə imkan verir.",
"Description[ca@valencia]": "Este connector permet enregistrar les activitats del KMail.",
"Description[ca]": "Aquest connector permet enregistrar les activitats del KMail.",
"Description[de]": "Mit diesem Modul können Sie KMail-Aktivitäten protokollieren.",
"Description[en_GB]": "This plugin allows you to log KMail activities.",
"Description[es]": "Este complemento le permite registrar las actividades de KMail.",
"Description[et]": "See plugin võimaldab logida KMaili tegevust.",
"Description[fi]": "Tällä liitännäisellä voi pitää KMailin toimista lokia.",
"Description[fr]": "Ce module permet de journaliser les activités de KMail.",
"Description[gl]": "Este complemento permite rexistrar a súa actividade con KMail.",
"Description[ia]": "Iste plugin te permitte registrar activitates de KMail.",
"Description[it]": "Questa estensione permette di registrare le attività di KMail.",
"Description[ko]": "이 플러그인은 KMail 활동 내역을 기록합니다.",
"Description[nl]": "Deze plug-in stelt u in staat KMail-activiteiten vast te leggen.",
"Description[pl]": "Ta wtyczka umożliwia rejestrowanie aktywności KMaila.",
"Description[pt]": "Este 'plugin' permite-lhe registar as actividades do KMail.",
"Description[pt_BR]": "Este plugin permite a você registrar as atividades do KMail.",
"Description[ru]": "Этот модуль позволяет записывать журнал действий KMail.",
"Description[sk]": "Tento plugin vám umožní zaznamenať aktivity KMail.",
"Description[sl]": "Ta vstavek omogoča beleženje dejavnosti KMail-a.",
"Description[sr@ijekavian]": "Овај прикључак омогућава бележење активности у К‑пошти",
"Description[sr@ijekavianlatin]": "Ovaj priključak omogućava beleženje aktivnosti u K‑pošti",
"Description[sr@latin]": "Ovaj priključak omogućava beleženje aktivnosti u K‑pošti",
"Description[sr]": "Овај прикључак омогућава бележење активности у К‑пошти",
"Description[sv]": "Insticksprogrammet gör det möjligt att logga aktiviteter i Kmail.",
"Description[tr]": "Bu eklenti, KMail etkinliklerini günlüklemenize imkan verir.",
"Description[uk]": "За допомогою цього додатка ви можете записувати журнал дій у KMail.",
"Description[x-test]": "xxThis plugin allows you to log KMail activities.xx",
"Description[zh_CN]": "此插件允许您记录 KMail 活动日志。",
"EnabledByDefault": "false",
"Id": "kmaillogactivities",
"Name": "Log Activities",
"Name[ar]": "تسجيل الأنشطة",
"Name[az]": "Fəaliyyət jurnalı",
"Name[ca@valencia]": "Registra les activitats",
"Name[ca]": "Registra les activitats",
"Name[cs]": "Zaznamenávat aktivity",
"Name[da]": "Log aktiviteter",
"Name[de]": "Aktivitäten protokollieren",
"Name[en_GB]": "Log Activities",
"Name[es]": "Registrar actividades",
"Name[et]": "Tegevuste logimine",
"Name[fi]": "Pidä toimista lokia",
"Name[fr]": "Journaliser les activités",
"Name[gl]": "Rexistrar as actividades",
"Name[ia]": "Activitates de registro",
"Name[it]": "Registra attività",
"Name[ko]": "활동 기록",
"Name[nl]": "Activiteiten vastleggen",
"Name[pl]": "Rejestruj aktywność",
"Name[pt]": "Registar as Actividades",
"Name[pt_BR]": "Registrar atividades",
"Name[ru]": "Журнал действий",
"Name[sk]": "Záznam aktivít",
"Name[sl]": "Beleži dejanja",
"Name[sr@ijekavian]": "Бележење активности",
"Name[sr@ijekavianlatin]": "Beleženje aktivnosti",
"Name[sr@latin]": "Beleženje aktivnosti",
"Name[sr]": "Бележење активности",
"Name[sv]": "Logga aktiviteter",
"Name[tr]": "Günlük Etkinlikleri",
"Name[uk]": "Запис журналу дій",
"Name[x-test]": "xxLog Activitiesxx",
"Name[zh_CN]": "记录活动日志",
"Version": "1.0"
}
}
/*
SPDX-FileCopyrightText: 2017-2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "logactivitiesplugin.h"
#include "logactivitiesplugininterface.h"
#include <KPluginFactory>
K_PLUGIN_CLASS_WITH_JSON(LogActivitiesPlugin, "kmail_logactivitiesplugin.json")
LogActivitiesPlugin::LogActivitiesPlugin(QObject *parent, const QList<QVariant> &)
: PimCommon::GenericPlugin(parent)
{
}
LogActivitiesPlugin::~LogActivitiesPlugin() = default;
PimCommon::GenericPluginInterface *LogActivitiesPlugin::createInterface(QObject *parent)
{
return new LogActivitiesPluginInterface(parent);
}
#include "logactivitiesplugin.moc"
/*
SPDX-FileCopyrightText: 2017-2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <PimCommon/GenericPlugin>
#include <PimCommonAkonadi/GenericPluginInterface>
#include <QVariant>
class LogActivitiesPlugin : public PimCommon::GenericPlugin
{
Q_OBJECT
public:
explicit LogActivitiesPlugin(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
~LogActivitiesPlugin() override;
PimCommon::GenericPluginInterface *createInterface(QObject *parent = nullptr) override;
};
/*
SPDX-FileCopyrightText: 2017-2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "logactivitiesplugininterface.h"
#include <KActionCollection>
#include <KLocalizedString>
#include <PimCommon/LogActivitiesManager>
#include <QAction>
LogActivitiesPluginInterface::LogActivitiesPluginInterface(QObject *parent)
: PimCommon::GenericPluginInterface(parent)
{
}
LogActivitiesPluginInterface::~LogActivitiesPluginInterface() = default;
void LogActivitiesPluginInterface::createAction(KActionCollection *ac)
{
auto action = new QAction(i18n("&Log Activities..."), this);
ac->addAction(QStringLiteral("logactivities"), action);
connect(action, &QAction::triggered, this, &LogActivitiesPluginInterface::slotActivated);
PimCommon::ActionType type(action, PimCommon::ActionType::Tools);
addActionType(type);
}
void LogActivitiesPluginInterface::slotActivated()
{
Q_EMIT emitPluginActivated(this);
}
void LogActivitiesPluginInterface::exec()
{
PimCommon::LogActivitiesManager::self()->showLogActivitiesDialog();
}
/*
SPDX-FileCopyrightText: 2017-2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <PimCommonAkonadi/GenericPluginInterface>
class LogActivitiesPluginInterface : public PimCommon::GenericPluginInterface
{
public:
explicit LogActivitiesPluginInterface(QObject *parent = nullptr);
~LogActivitiesPluginInterface() override;
void exec() override;
void createAction(KActionCollection *ac) override;
private:
void slotActivated();
};
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