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

Add more autotests

parent 1cfdddb7
include_directories(${CMAKE_CURRENT_BINARY_DIR})
#if(BUILD_TESTING)
# add_subdirectory(tests)
# add_subdirectory(autotests)
#endif()
if(BUILD_TESTING)
add_subdirectory(tests)
add_subdirectory(autotests)
endif()
set(regexpeditorlineeditplugin_SRCS
......
/*
Copyright (C) 2017 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 "regexpeditorlineedittest.h"
#include <QTest>
RegexpEditorLineEditTest::RegexpEditorLineEditTest(QObject *parent)
: QObject(parent)
{
}
QTEST_MAIN(RegexpEditorLineEditTest)
/*
Copyright (C) 2017 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 REGEXPEDITORLINEEDITTEST_H
#define REGEXPEDITORLINEEDITTEST_H
#include <QObject>
class RegexpEditorLineEditTest : public QObject
{
Q_OBJECT
public:
explicit RegexpEditorLineEditTest(QObject *parent = nullptr);
~RegexpEditorLineEditTest() = default;
};
#endif // REGEXPEDITORLINEEDITTEST_H
......@@ -18,8 +18,12 @@
*/
#include "regexpeditorlineedit.h"
#include <kpluginfactory.h>
#include <QStackedWidget>
#include <QHBoxLayout>
K_PLUGIN_FACTORY_WITH_JSON(RegexpEditorLineEditFactory, "regexepeditorlineedit.json", registerPlugin<RegexpEditorLineEdit>();
)
......@@ -27,6 +31,13 @@ RegexpEditorLineEdit::RegexpEditorLineEdit(QWidget *parent, const QList<QVariant
: KSieveUi::AbstractRegexpEditorLineEdit(parent)
, mIsRegExpMode(false)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setMargin(0);
mStackedWidget = new QStackedWidget(this);
mStackedWidget->setObjectName(QStringLiteral("stackedwidget"));
mainLayout->addWidget(mStackedWidget);
}
RegexpEditorLineEdit::~RegexpEditorLineEdit()
......
......@@ -22,7 +22,7 @@
#include <QWidget>
#include <KSieveUi/AbstractRegexpEditorLineEdit>
class QStackedWidget;
class RegexpEditorLineEdit : public KSieveUi::AbstractRegexpEditorLineEdit
{
Q_OBJECT
......@@ -34,6 +34,7 @@ public:
void setCode(const QString &str) Q_DECL_OVERRIDE;
QString code() const Q_DECL_OVERRIDE;
private:
QStackedWidget *mStackedWidget;
bool mIsRegExpMode;
};
......
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