on xenial help sign in
Some string-related improvements
2cef79aDaniel d'Andrada
tests/plugins/Ubuntu/Gestures/GestureTest.cpp+3−3
@@ -21,8 +21,8 @@
21#include <QQuickView>
21#include <QQuickView>
22#include <QtTest>
22#include <QtTest>
23
23
24−GestureTest::GestureTest(const char *qmlFile)
24+GestureTest::GestureTest(const QString &qmlFilename)
25− : QObject(), m_device(nullptr), m_view(nullptr), m_qmlFilename(qmlFile)
25+ : QObject(), m_device(nullptr), m_view(nullptr), m_qmlFilename(qmlFilename)
26{
26{
27}
27}
28
28
@@ -39,7 +39,7 @@ void GestureTest::init()
39{
39{
40 m_view = new QQuickView;
40 m_view = new QQuickView;
41 m_view->setResizeMode(QQuickView::SizeViewToRootObject);
41 m_view->setResizeMode(QQuickView::SizeViewToRootObject);
42− m_view->engine()->addImportPath(QLatin1String(UBUNTU_GESTURES_PLUGIN_DIR));
42+ m_view->engine()->addImportPath(QStringLiteral(UBUNTU_GESTURES_PLUGIN_DIR));
43 m_view->setSource(QUrl::fromLocalFile(m_qmlFilename));
43 m_view->setSource(QUrl::fromLocalFile(m_qmlFilename));
44 m_view->show();
44 m_view->show();
45 QVERIFY(QTest::qWaitForWindowExposed(m_view));
45 QVERIFY(QTest::qWaitForWindowExposed(m_view));
tests/plugins/Ubuntu/Gestures/GestureTest.h+2−2
@@ -29,8 +29,8 @@ class GestureTest : public QObject
29{
29{
30 Q_OBJECT
30 Q_OBJECT
31public:
31public:
32− // \param qmlFile name of the qml file to be loaded by the QQuickView
32+ // \param qmlFilename name of the qml file to be loaded by the QQuickView
33− GestureTest(const char *qmlFile);
33+ GestureTest(const QString &qmlFilename);
34
34
35protected Q_SLOTS:
35protected Q_SLOTS:
36 void initTestCase(); // will be called before the first test function is executed
36 void initTestCase(); // will be called before the first test function is executed
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+6−1
@@ -66,7 +66,7 @@ class tst_DirectionalDragArea: public GestureTest
66{
66{
67 Q_OBJECT
67 Q_OBJECT
68public:
68public:
69− tst_DirectionalDragArea() : GestureTest("tst_DirectionalDragArea.qml") {}
69+ tst_DirectionalDragArea();
70private Q_SLOTS:
70private Q_SLOTS:
71 void init(); // called right before each and every test function is executed
71 void init(); // called right before each and every test function is executed
72 void cleanup(); // called right after each and every test function is executed
72 void cleanup(); // called right after each and every test function is executed
@@ -90,6 +90,11 @@ private:
90 QSharedPointer<FakeTimeSource> fakeTimeSource;
90 QSharedPointer<FakeTimeSource> fakeTimeSource;
91};
91};
92
92
93+tst_DirectionalDragArea::tst_DirectionalDragArea()
94+ : GestureTest(QStringLiteral("tst_DirectionalDragArea.qml"))
95+{
96+}
97+
93void tst_DirectionalDragArea::init()
98void tst_DirectionalDragArea::init()
94{
99{
95 GestureTest::init();
100 GestureTest::init();