summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-06-07 07:06:33 +0200
committerMontel Laurent <[email protected]>2016-06-07 07:06:33 +0200
commita4c48b583d907671a6499b4a806ca3897f6a89b7 (patch)
tree4acb4a7ff6c6e84383476836bcc38456b26a47f8
parent016a49ad876e956431c1b87d50d6ef03d19189d4 (diff)
Add more code
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt4
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.cpp43
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.h37
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.cpp43
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.h35
-rw-r--r--kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendplugin.cpp6
6 files changed, 166 insertions, 2 deletions
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt b/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt
index 2e9e943..ac00839 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt
@@ -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")
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.cpp
new file mode 100644
index 0000000..d2a2e80
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.cpp
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ 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)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.h b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.h
new file mode 100644
index 0000000..b0e1edf
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendinterfacetest.h
@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ 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
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.cpp
new file mode 100644
index 0000000..8bd8ebe
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.cpp
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ 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)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.h b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.h
new file mode 100644
index 0000000..73db35e
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendplugintest.h
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2016 Montel Laurent <[email protected]>
+
+ 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
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendplugin.cpp b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendplugin.cpp
index d1ce79a..bdd7ce3 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendplugin.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendplugin.cpp
@@ -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