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

Add autotes

parent 623cbfc0
macro(add_messageviewer_viewer_renderer_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source}
TEST_NAME ${_name}
NAME_PREFIX "messageviewer-"
LINK_LIBRARIES KF5::MessageViewer Qt5::Test
)
endmacro ()
add_messageviewer_viewer_renderer_unittest(messageviewerrenderertest.cpp)
/*
Copyright (C) 2019 Laurent Montel <montel@kde.org>
Code based on ARHParser.jsm from dkim_verifier (Copyright (c) Philippe Lieser)
(This software is licensed under the terms of the MIT License.)
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 "messageviewerrenderertest.h"
#include <QTest>
QTEST_MAIN(MessageViewerRendererTest)
MessageViewerRendererTest::MessageViewerRendererTest(QObject *parent)
: QObject(parent)
{
}
/*
Copyright (C) 2019 Laurent Montel <montel@kde.org>
Code based on ARHParser.jsm from dkim_verifier (Copyright (c) Philippe Lieser)
(This software is licensed under the terms of the MIT License.)
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 MESSAGEVIEWERRENDERERTEST_H
#define MESSAGEVIEWERRENDERERTEST_H
#include <QObject>
class MessageViewerRendererTest : public QObject
{
Q_OBJECT
public:
explicit MessageViewerRendererTest(QObject *parent = nullptr);
~MessageViewerRendererTest() = default;
};
#endif // MESSAGEVIEWERRENDERERTEST_H
......@@ -37,3 +37,19 @@ CSSHelper *MessageViewerRenderer::cssHelper() const
{
return mCSSHelper;
}
QWidget *MessageViewerRenderer::currentWidget() const
{
return mCurrentWidget;
}
void MessageViewerRenderer::setCurrentWidget(QWidget *currentWidget)
{
mCurrentWidget = currentWidget;
}
void MessageViewerRenderer::recreateCssHelper()
{
delete mCSSHelper;
mCSSHelper = new CSSHelper(mCurrentWidget);
}
......@@ -24,7 +24,7 @@
#define MESSAGEVIEWERRENDERER_H
#include "messageviewer_private_export.h"
#include <QWidget>
namespace MessageViewer {
class CSSHelper;
class MESSAGEVIEWER_TESTS_EXPORT MessageViewerRenderer
......@@ -35,8 +35,13 @@ public:
CSSHelper *cssHelper() const;
QWidget *currentWidget() const;
void setCurrentWidget(QWidget *currentWidget);
void recreateCssHelper();
private:
CSSHelper *mCSSHelper = nullptr;
QWidget *mCurrentWidget = nullptr;
};
}
......
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