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

Add new class for reducing duplicate code

parent 332cd618
......@@ -86,6 +86,7 @@ if (${Qca-qt5_FOUND})
dkim-verify/dkimmanagerrules.cpp
dkim-verify/dkimgeneraterulejob.cpp
dkim-verify/dkimauthenticationstatusinfoutil.cpp
dkim-verify/dkimcheckfulljob.cpp
)
endif()
......
......@@ -31,3 +31,4 @@ add_messageviewer_dkim_verify_unittest(dkimmanagerrulestest.cpp)
add_messageviewer_dkim_verify_unittest(dkimwidgetinfotest.cpp)
add_messageviewer_dkim_verify_unittest(dkimgeneraterulejobtest.cpp)
add_messageviewer_dkim_verify_unittest(dkimauthenticationstatusinfoutiltest.cpp)
add_messageviewer_dkim_verify_unittest(dkimcheckfulljobtest.cpp)
/*
Copyright (C) 2019 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "dkimcheckfulljobtest.h"
#include <QTest>
QTEST_MAIN(DKIMCheckFullJobTest)
DKIMCheckFullJobTest::DKIMCheckFullJobTest(QObject *parent)
: QObject(parent)
{
}
/*
Copyright (C) 2019 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef DKIMCHECKFULLJOBTEST_H
#define DKIMCHECKFULLJOBTEST_H
#include <QObject>
class DKIMCheckFullJobTest : public QObject
{
Q_OBJECT
public:
explicit DKIMCheckFullJobTest(QObject *parent = nullptr);
~DKIMCheckFullJobTest() = default;
};
#endif // DKIMCHECKFULLJOBTEST_H
/*
Copyright (C) 2019 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "dkimcheckfulljob.h"
#include "messageviewer_dkimcheckerdebug.h"
using namespace MessageViewer;
DKIMCheckFullJob::DKIMCheckFullJob(QObject *parent)
: QObject(parent)
{
}
DKIMCheckFullJob::~DKIMCheckFullJob()
{
}
bool DKIMCheckFullJob::canStart() const
{
//TODO
return false;
}
bool DKIMCheckFullJob::start()
{
if (!canStart()) {
qCWarning(MESSAGEVIEWER_DKIMCHECKER_LOG) << "Impossible to start job";
deleteLater();
return false;
}
return true;
}
/*
Copyright (C) 2019 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef DKIMCHECKFULLJOB_H
#define DKIMCHECKFULLJOB_H
#include <QObject>
#include "messageviewer_private_export.h"
#include <QObject>
namespace MessageViewer {
class MESSAGEVIEWER_TESTS_EXPORT DKIMCheckFullJob : public QObject
{
Q_OBJECT
public:
explicit DKIMCheckFullJob(QObject *parent = nullptr);
~DKIMCheckFullJob();
Q_REQUIRED_RESULT bool canStart() const;
Q_REQUIRED_RESULT bool start();
};
}
#endif // DKIMCHECKFULLJOB_H
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