Commit a4c48b58 authored by Laurent Montel's avatar Laurent Montel 😁

Add more code

parent 016a49ad
......@@ -10,3 +10,7 @@ macro(add_kmail_checkbeforesend_unittest _source _additional)
ecm_mark_as_test(kmail_editorplugin-${_name})
target_link_libraries( ${_name} Qt5::Test KF5::IconThemes KF5::MessageComposer KF5::I18n KF5::PimCommon)
endmacro ()
add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp "../checkbeforesendplugin.cpp;../checkbeforesendinterface.cpp")
add_kmail_checkbeforesend_unittest(checkbeforesendinterfacetest.cpp "../checkbeforesendinterface.cpp")
/*
Copyright (C) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "checkbeforesendinterfacetest.h"
#include "../checkbeforesendinterface.h"
#include <QTest>
CheckBeforeSendInterfaceTest::CheckBeforeSendInterfaceTest(QObject *parent)
: QObject(parent)
{
}
CheckBeforeSendInterfaceTest::~CheckBeforeSendInterfaceTest()
{
}
void CheckBeforeSendInterfaceTest::shouldHaveDefaultValue()
{
CheckBeforeSendInterface interface;
//QVERIFY(interface.)
}
QTEST_MAIN(CheckBeforeSendInterfaceTest)
/*
Copyright (C) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef CHECKBEFORESENDINTERFACETEST_H
#define CHECKBEFORESENDINTERFACETEST_H
#include <QObject>
class CheckBeforeSendInterfaceTest : public QObject
{
Q_OBJECT
public:
explicit CheckBeforeSendInterfaceTest(QObject *parent = Q_NULLPTR);
~CheckBeforeSendInterfaceTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // CHECKBEFORESENDINTERFACETEST_H
/*
Copyright (C) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "checkbeforesendplugintest.h"
#include "../checkbeforesendplugin.h"
#include <QTest>
CheckBeforeSendPluginTest::CheckBeforeSendPluginTest(QObject *parent)
: QObject(parent)
{
}
CheckBeforeSendPluginTest::~CheckBeforeSendPluginTest()
{
}
void CheckBeforeSendPluginTest::shouldHaveDefaultValue()
{
CheckBeforeSendPlugin plugin;
QVERIFY(plugin.hasConfigureSupport());
//TODO more
}
QTEST_MAIN(CheckBeforeSendPluginTest)
/*
Copyright (C) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef CHECKBEFORESENDPLUGINTEST_H
#define CHECKBEFORESENDPLUGINTEST_H
#include <QObject>
class CheckBeforeSendPluginTest : public QObject
{
Q_OBJECT
public:
explicit CheckBeforeSendPluginTest(QObject *parent = Q_NULLPTR);
~CheckBeforeSendPluginTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // CHECKBEFORESENDPLUGINTEST_H
......@@ -18,6 +18,7 @@
*/
#include "checkbeforesendplugin.h"
#include "checkbeforesendinterface.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
......@@ -38,8 +39,9 @@ CheckBeforeSendPlugin::~CheckBeforeSendPlugin()
MessageComposer::PluginEditorCheckBeforeSendInterface *CheckBeforeSendPlugin::createInterface(QObject *parent)
{
//TODO
return {};
CheckBeforeSendInterface *interface = new CheckBeforeSendInterface(parent);
connect(this, &CheckBeforeSendPlugin::configChanged, interface, &CheckBeforeSendInterface::reloadConfig);
return interface;
}
bool CheckBeforeSendPlugin::hasConfigureSupport() const
......
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