Commit 13d26538 authored by Laurent Montel's avatar Laurent Montel 😁

Convert to pointer. Still in investigation.

parent 765c6c4d
...@@ -27,46 +27,47 @@ ViewerTest::ViewerTest() ...@@ -27,46 +27,47 @@ ViewerTest::ViewerTest()
void ViewerTest::shouldHaveDefaultValuesOnCreation() void ViewerTest::shouldHaveDefaultValuesOnCreation()
{ {
MessageViewer::Viewer viewer(0, 0, new KActionCollection(this)); MessageViewer::Viewer *viewer = new MessageViewer::Viewer(0, 0, new KActionCollection(this));
viewer.show(); viewer->show();
QTest::qWaitForWindowExposed(&viewer); QTest::qWaitForWindowExposed(viewer);
QWidget *mViewer = viewer.findChild<QWidget *>(QStringLiteral("mViewer")); QWidget *mViewer = viewer->findChild<QWidget *>(QStringLiteral("mViewer"));
QVERIFY(mViewer); QVERIFY(mViewer);
QCOMPARE(mViewer->isVisible(), true); QCOMPARE(mViewer->isVisible(), true);
QWidget *sliderContainer = viewer.findChild<QWidget *>(QStringLiteral("slidercontainer")); QWidget *sliderContainer = viewer->findChild<QWidget *>(QStringLiteral("slidercontainer"));
QVERIFY(sliderContainer); QVERIFY(sliderContainer);
QCOMPARE(sliderContainer->isVisible(), false); QCOMPARE(sliderContainer->isVisible(), false);
QWidget *colorBar = viewer.findChild<QWidget *>(QStringLiteral("mColorBar")); QWidget *colorBar = viewer->findChild<QWidget *>(QStringLiteral("mColorBar"));
QVERIFY(colorBar); QVERIFY(colorBar);
QWidget *scandetectionWidget = viewer.findChild<QWidget *>(QStringLiteral("scandetectionwarning")); QWidget *scandetectionWidget = viewer->findChild<QWidget *>(QStringLiteral("scandetectionwarning"));
QVERIFY(scandetectionWidget); QVERIFY(scandetectionWidget);
QCOMPARE(scandetectionWidget->isVisible(), false); QCOMPARE(scandetectionWidget->isVisible(), false);
QWidget *openattachementfolderwidget = viewer.findChild<QWidget *>(QStringLiteral("openattachementfolderwidget")); QWidget *openattachementfolderwidget = viewer->findChild<QWidget *>(QStringLiteral("openattachementfolderwidget"));
QVERIFY(openattachementfolderwidget); QVERIFY(openattachementfolderwidget);
QCOMPARE(openattachementfolderwidget->isVisible(), false); QCOMPARE(openattachementfolderwidget->isVisible(), false);
QVERIFY(viewer.toggleFixFontAction()); QVERIFY(viewer->toggleFixFontAction());
QVERIFY(viewer.toggleMimePartTreeAction()); QVERIFY(viewer->toggleMimePartTreeAction());
QVERIFY(viewer.selectAllAction()); QVERIFY(viewer->selectAllAction());
QVERIFY(viewer.copyURLAction()); QVERIFY(viewer->copyURLAction());
QVERIFY(viewer.copyAction()); QVERIFY(viewer->copyAction());
QVERIFY(viewer.urlOpenAction()); QVERIFY(viewer->urlOpenAction());
QVERIFY(viewer.speakTextAction()); QVERIFY(viewer->speakTextAction());
QVERIFY(viewer.copyImageLocation()); QVERIFY(viewer->copyImageLocation());
QVERIFY(viewer.viewSourceAction()); QVERIFY(viewer->viewSourceAction());
QVERIFY(viewer.findInMessageAction()); QVERIFY(viewer->findInMessageAction());
QVERIFY(viewer.saveAsAction()); QVERIFY(viewer->saveAsAction());
QVERIFY(viewer.saveMessageDisplayFormatAction()); QVERIFY(viewer->saveMessageDisplayFormatAction());
QVERIFY(viewer.resetMessageDisplayFormatAction()); QVERIFY(viewer->resetMessageDisplayFormatAction());
QVERIFY(viewer.urlClicked().isEmpty()); QVERIFY(viewer->urlClicked().isEmpty());
QVERIFY(viewer.imageUrlClicked().isEmpty()); QVERIFY(viewer->imageUrlClicked().isEmpty());
QCOMPARE(viewer.isFixedFont(), false); QCOMPARE(viewer->isFixedFont(), false);
QVERIFY(viewer.shareServiceUrlMenu()); QVERIFY(viewer->shareServiceUrlMenu());
delete viewer;
} }
QTEST_MAIN(ViewerTest) QTEST_MAIN(ViewerTest)
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