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

Use new class

parent 16de0f3c
......@@ -5,6 +5,7 @@ set(kmail_confirmaddresseditorplugin_SRCS
confirmaddressdialog.cpp
confirmaddresswidget.cpp
confirmaddressconfiguretabwidget.cpp
confirmaddressconfiguretab.cpp
)
ecm_qt_declare_logging_category(kmail_confirmaddresseditorplugin_SRCS HEADER confirmaddressplugin_debug.h IDENTIFIER KMAIL_EDITOR_CONFIRMADDRESS_PLUGIN_LOG CATEGORY_NAME log_kmail_confirmaddressplugin)
......
......@@ -22,3 +22,5 @@ add_kmail_confirmaddress_unittest(confirmaddressdialogtest.cpp "../confirmaddres
add_kmail_confirmaddress_unittest(confirmaddresswidgettest.cpp "../confirmaddresswidget.cpp")
add_kmail_confirmaddress_unittest(confirmaddressconfiguretabwidgettest.cpp "../confirmaddressconfiguretabwidget.cpp")
add_kmail_confirmaddress_unittest(confirmaddressconfiguretabtest.cpp "../confirmaddressconfiguretab.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 "confirmaddressconfiguretabtest.h"
#include "../confirmaddressconfiguretab.h"
#include <QBoxLayout>
#include <QTabWidget>
#include <QTest>
ConfirmAddressConfigureTabTest::ConfirmAddressConfigureTabTest(QObject *parent)
: QObject(parent)
{
}
ConfirmAddressConfigureTabTest::~ConfirmAddressConfigureTabTest()
{
}
void ConfirmAddressConfigureTabTest::shouldHaveDefaultValue()
{
ConfirmAddressConfigureTab w;
QVBoxLayout *vboxlayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(vboxlayout);
QCOMPARE(vboxlayout->margin(), 0);
QTabWidget *mTabWidget = w.findChild<QTabWidget *>(QStringLiteral("tabwidget"));
QVERIFY(mTabWidget);
}
QTEST_MAIN(ConfirmAddressConfigureTabTest)
/*
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 CONFIRMADDRESSCONFIGURETABTEST_H
#define CONFIRMADDRESSCONFIGURETABTEST_H
#include <QObject>
class ConfirmAddressConfigureTabTest : public QObject
{
Q_OBJECT
public:
explicit ConfirmAddressConfigureTabTest(QObject *parent = Q_NULLPTR);
~ConfirmAddressConfigureTabTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // CONFIRMADDRESSCONFIGURETABTEST_H
......@@ -18,7 +18,10 @@
*/
#include "confirmaddressconfiguretabwidgettest.h"
#include "../confirmaddressconfiguretabwidget.h"
#include <QTest>
#include <QVBoxLayout>
#include <QTabWidget>
ConfirmAddressConfigureTabWidgetTest::ConfirmAddressConfigureTabWidgetTest(QObject *parent)
: QObject(parent)
......@@ -31,4 +34,8 @@ ConfirmAddressConfigureTabWidgetTest::~ConfirmAddressConfigureTabWidgetTest()
}
void ConfirmAddressConfigureTabWidgetTest::shouldHaveDefaultValue()
{
}
QTEST_MAIN(ConfirmAddressConfigureTabWidgetTest)
......@@ -28,6 +28,8 @@ class ConfirmAddressConfigureTabWidgetTest : public QObject
public:
explicit ConfirmAddressConfigureTabWidgetTest(QObject *parent = Q_NULLPTR);
~ConfirmAddressConfigureTabWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // CONFIRMADDRESSCONFIGURETABWIDGETTEST_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 "confirmaddressconfiguretab.h"
#include <QVBoxLayout>
#include <QTabWidget>
ConfirmAddressConfigureTab::ConfirmAddressConfigureTab(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setMargin(0);
mTabWidget = new QTabWidget(this);
mTabWidget->setObjectName(QStringLiteral("tabwidget"));
mainLayout->addWidget(mTabWidget);
}
ConfirmAddressConfigureTab::~ConfirmAddressConfigureTab()
{
}
/*
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 CONFIRMADDRESSCONFIGURETAB_H
#define CONFIRMADDRESSCONFIGURETAB_H
#include <QWidget>
class QTabWidget;
class ConfirmAddressConfigureTab : public QWidget
{
Q_OBJECT
public:
explicit ConfirmAddressConfigureTab(QWidget *parent = Q_NULLPTR);
~ConfirmAddressConfigureTab();
Q_SIGNALS:
void configureChanged();
private:
QTabWidget *mTabWidget;
};
#endif // CONFIRMADDRESSCONFIGURETAB_H
......@@ -18,17 +18,12 @@
*/
#include "confirmaddressconfiguretabwidget.h"
#include <QTabWidget>
#include <KLocalizedString>
#include <QVBoxLayout>
ConfirmAddressConfigureTabWidget::ConfirmAddressConfigureTabWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setMargin(0);
}
ConfirmAddressConfigureTabWidget::~ConfirmAddressConfigureTabWidget()
......
......@@ -28,8 +28,9 @@ class ConfirmAddressConfigureTabWidget : public QWidget
public:
explicit ConfirmAddressConfigureTabWidget(QWidget *parent = Q_NULLPTR);
~ConfirmAddressConfigureTabWidget();
private:
QTabWidget *mTabWidget;
Q_SIGNALS:
void configureChanged();
};
#endif // CONFIRMADDRESSCONFIGURETABWIDGET_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