Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 752dae2e authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile against qt5.13

parent fa021388
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
......@@ -21,6 +21,7 @@
#include "../searchduplicate/searchduplicateresultwidget.h"
#include "../searchduplicate/resultduplicatetreewidget.h"
#include "../widgets/mergecontactloseinformationwarning.h"
#include "kdepimtest_layout.h"
#include <KaddressbookGrantlee/GrantleeContactViewer>
#include <QSplitter>
#include <QLayout>
......@@ -67,7 +68,7 @@ void SearchDuplicateResultWidgetTest::shouldHaveDefaultValue()
{
KABMergeContacts::SearchDuplicateResultWidget w;
QCOMPARE(w.layout()->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, w.layout());
KABMergeContacts::ResultDuplicateTreeWidget *tree = w.findChild<KABMergeContacts::ResultDuplicateTreeWidget *>(QStringLiteral("result_treewidget"));
QVERIFY(tree);
......
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
......@@ -19,6 +19,7 @@
#include "markdownconfigurewidgettest.h"
#include "../markdownconfigurewidget.h"
#include "kdepimtest_layout.h"
#include <QCheckBox>
#include <QComboBox>
#include <QHBoxLayout>
......@@ -36,7 +37,7 @@ void MarkdownConfigureWidgetTest::shouldHaveDefaultValue()
MarkdownConfigureWidget w;
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
QCheckBox *mLatexSupport = w.findChild<QCheckBox *>(QStringLiteral("latex"));
QVERIFY(mLatexSupport);
......
......@@ -19,6 +19,7 @@
#include "markdowncreatelinkwidgettest.h"
#include "markdowncreatelinkwidget.h"
#include "kdepimtest_layout.h"
#include <QFormLayout>
#include <QLineEdit>
#include <QTest>
......@@ -36,7 +37,7 @@ void MarkdownCreateLinkWidgetTest::shouldHaveDefaultValue()
QFormLayout *mainLayout = w.findChild<QFormLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
mainLayout->setContentsMargins(0, 0, 0, 0);
......
......@@ -19,6 +19,7 @@
#include "markdownpreviewwidgettest.h"
#include "markdownpreviewwidget.h"
#include "kdepimtest_layout.h"
#include <QHBoxLayout>
#include <QTest>
#include <QWebChannel>
......@@ -35,7 +36,7 @@ void MarkdownPreviewWidgetTest::shouldHaveDefaultValue()
MarkdownPreviewWidget w;
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
QWebEngineView *mWebView = w.findChild<QWebEngineView *>(QStringLiteral("webengine"));
QVERIFY(mWebView);
......
......@@ -19,6 +19,7 @@
#include "externalcomposerconfigurewidgettest.h"
#include "../externalcomposerconfigurewidget.h"
#include "kdepimtest_layout.h"
#include <QCheckBox>
#include <QVBoxLayout>
#include <QLabel>
......@@ -37,7 +38,7 @@ void ExternalComposerConfigureWidgetTest::shouldHaveDefaultValues()
ExternalComposerConfigureWidget w(nullptr);
QVBoxLayout *vboxlayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(vboxlayout);
QCOMPARE(vboxlayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, vboxlayout);
QCheckBox *mExternalEditorCheck = w.findChild<QCheckBox *>(QStringLiteral("enabled"));
QVERIFY(mExternalEditorCheck);
......
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
......@@ -19,6 +19,7 @@
#include "insertshorturlconfigurewidgettest.h"
#include "../insertshorturlconfigurewidget.h"
#include "kdepimtest_layout.h"
#include <QComboBox>
#include <QLabel>
......@@ -38,7 +39,7 @@ void InsertShorturlConfigureWidgetTest::shouldHaveDefaultValues()
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
QLabel *lab = w.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(lab);
......
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
......@@ -19,6 +19,7 @@
#include "automaticaddcontactsconfiguretabtest.h"
#include "../automaticaddcontactsconfiguretab.h"
#include "kdepimtest_layout.h"
#include <QTest>
#include <QStandardPaths>
#include <QHBoxLayout>
......@@ -39,7 +40,7 @@ void AutomaticAddContactsConfigureTabTest::shouldHaveDefaultValue()
AutomaticAddContactsConfigureTab w(nullptr);
QHBoxLayout *vboxlayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(vboxlayout);
QCOMPARE(vboxlayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, vboxlayout);
QTabWidget *mTabWidget = w.findChild<QTabWidget *>(QStringLiteral("tabwidget"));
QVERIFY(mTabWidget);
}
......
......@@ -19,7 +19,7 @@
#include "automaticaddcontactstabwidgettest.h"
#include "../automaticaddcontactstabwidget.h"
#include "kdepimtest_layout.h"
#include <QCheckBox>
#include <QTest>
#include <QVBoxLayout>
......@@ -74,7 +74,7 @@ void AutomaticAddContactsTabWidgetTest::shouldHaveDefaultValue()
QHBoxLayout *hlay = w->findChild<QHBoxLayout *>(QStringLiteral("folderlayout"));
QVERIFY(hlay);
QCOMPARE(hlay->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, hlay);
QLabel *lab = w->findChild<QLabel *>(QStringLiteral("labelfolder"));
QVERIFY(lab);
......
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
......@@ -19,7 +19,7 @@
#include "confirmaddressconfiguretabtest.h"
#include "../confirmaddressconfiguretab.h"
#include "kdepimtest_layout.h"
#include <QTabWidget>
#include <QTest>
#include <QVBoxLayout>
......@@ -38,7 +38,7 @@ void ConfirmAddressConfigureTabTest::shouldHaveDefaultValue()
ConfirmAddressConfigureTab w(nullptr);
QVBoxLayout *vboxlayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(vboxlayout);
QCOMPARE(vboxlayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, vboxlayout);
QTabWidget *mTabWidget = w.findChild<QTabWidget *>(QStringLiteral("tabwidget"));
QVERIFY(mTabWidget);
......
......@@ -19,6 +19,7 @@
#include "confirmaddresswidgettest.h"
#include "../confirmaddresswidget.h"
#include "kdepimtest_layout.h"
#include <QTest>
#include <QVBoxLayout>
#include <QListWidget>
......@@ -40,7 +41,7 @@ void ConfirmAddressWidgetTest::shouldHaveDefaultValue()
ConfirmAddressWidget w;
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
QListWidget *listEmails = w.findChild<QListWidget *>(QStringLiteral("listemails"));
QVERIFY(listEmails);
......
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
......@@ -19,6 +19,7 @@
#include "grammalecteconfigwidgettest.h"
#include "grammalecteconfigwidget.h"
#include "kdepimtest_layout.h"
#include <QTabWidget>
#include <QTest>
#include <QVBoxLayout>
......@@ -41,7 +42,7 @@ void GrammalecteConfigWidgetTest::shouldHaveDefaultValue()
GrammalecteConfigWidget w(nullptr, true);
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
QTabWidget *mTab = w.findChild<QTabWidget *>(QStringLiteral("mTab"));
QVERIFY(mTab);
......
......@@ -20,6 +20,7 @@
#include "grammalecteresultwidgettest.h"
#include "grammalecteresultwidget.h"
#include "grammarresulttextedit.h"
#include "kdepimtest_layout.h"
#include <QHBoxLayout>
#include <QTest>
QTEST_MAIN(GrammarResultWidgetTest)
......@@ -34,7 +35,7 @@ void GrammarResultWidgetTest::shouldHaveDefaultValue()
GrammalecteResultWidget w;
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
GrammarResultTextEdit *mResult = w.findChild<GrammarResultTextEdit *>(QStringLiteral("grammarResult"));
QVERIFY(mResult);
}
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
......@@ -20,6 +20,7 @@
#include "languagetoolconfigwidgettest.h"
#include "languagetoolconfigwidget.h"
#include "languagetoolcombobox.h"
#include "kdepimtest_layout.h"
#include <QCheckBox>
#include <QLabel>
#include <QLineEdit>
......@@ -40,7 +41,7 @@ void LanguageToolConfigWidgetTest::shouldHaveDefaultValue()
LanguageToolConfigWidget w;
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
QCheckBox *mUseLocalInstance = w.findChild<QCheckBox *>(QStringLiteral("uselocalinstance"));
QVERIFY(mUseLocalInstance);
......
......@@ -19,6 +19,7 @@
#include "languagetoolresultwidgettest.h"
#include "languagetoolresultwidget.h"
#include "kdepimtest_layout.h"
#include <QTest>
#include <QHBoxLayout>
#include <grammarresulttextedit.h>
......@@ -33,7 +34,7 @@ void LanguageToolResultWidgetTest::shouldHaveDefaultValue()
LanguageToolResultWidget w;
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
GrammarResultTextEdit *mResult = w.findChild<GrammarResultTextEdit *>(QStringLiteral("grammarResult"));
QVERIFY(mResult);
}
......@@ -19,6 +19,7 @@
#include "gravatarconfiguresettingspluginwidgettest.h"
#include "../gravatarconfiguresettingspluginwidget.h"
#include "kdepimtest_layout.h"
#include <Gravatar/GravatarConfigWidget>
#include <QTest>
#include <QVBoxLayout>
......@@ -36,7 +37,7 @@ void GravatarConfigureSettingsPluginWidgetTest::shouldHaveDefaultValue()
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
KdepimTestLayout::checkContentsMargins(0, mainLayout);
Gravatar::GravatarConfigWidget *mGravatarConfigWidget = w.findChild<Gravatar::GravatarConfigWidget *>(QStringLiteral("gravatarconfigwidget"));
QVERIFY(mGravatarConfigWidget);
......
/*
Copyright (C) 2019 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 KDEPIMTEST_LAYOUT_H
#define KDEPIMTEST_LAYOUT_H
#include <QTest>
#include <QLayout>
namespace KdepimTestLayout
{
void checkContentsMargins(int margin, QLayout *layout)
{
int top = -1;
int bottom = -1;
int left = -1;
int right = -1;
layout->getContentsMargins(&left, &top, &right, &bottom);
QCOMPARE(top, margin);
QCOMPARE(left, margin);
QCOMPARE(bottom, margin);
QCOMPARE(right, margin);
}
}
#endif
/*
Copyright (C) 2019 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.