Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/plugins/folder/autotests/positionertest.cpp
Show All 29 Lines | |||||
30 | #include "foldermodel.h" | 30 | #include "foldermodel.h" | ||
31 | #include "positioner.h" | 31 | #include "positioner.h" | ||
32 | #include "screenmapper.h" | 32 | #include "screenmapper.h" | ||
33 | 33 | | |||
34 | QTEST_MAIN(PositionerTest) | 34 | QTEST_MAIN(PositionerTest) | ||
35 | 35 | | |||
36 | static const QLatin1String desktop(QLatin1String("Desktop")); | 36 | static const QLatin1String desktop(QLatin1String("Desktop")); | ||
37 | 37 | | |||
38 | void PositionerTest::initTestCase() | 38 | void PositionerTest::initTestCase() | ||
mlaurent: I don't think that it used in this file. | |||||
39 | { | 39 | { | ||
40 | m_folderDir = new QTemporaryDir(); | 40 | m_folderDir = new QTemporaryDir(); | ||
41 | 41 | | |||
42 | QDir dir(m_folderDir->path()); | 42 | QDir dir(m_folderDir->path()); | ||
43 | dir.mkdir(desktop); | 43 | dir.mkdir(desktop); | ||
44 | dir.cd(desktop); | 44 | dir.cd(desktop); | ||
45 | dir.mkdir("firstDir"); | 45 | dir.mkdir("firstDir"); | ||
46 | QFile f; | 46 | QFile f; | ||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 254 | auto verifyMapping = [](const QHash<int, int> &actual, const QHash<int, int> &expected) { | |||
265 | QCOMPARE(actual, expected); | 265 | QCOMPARE(actual, expected); | ||
266 | }; | 266 | }; | ||
267 | 267 | | |||
268 | verifyMapping(m_positioner->proxyToSourceMapping(), expectedProxy2SourceScreen0); | 268 | verifyMapping(m_positioner->proxyToSourceMapping(), expectedProxy2SourceScreen0); | ||
269 | verifyMapping(m_positioner->sourceToProxyMapping(), expectedSource2ProxyScreen0); | 269 | verifyMapping(m_positioner->sourceToProxyMapping(), expectedSource2ProxyScreen0); | ||
270 | verifyMapping(secondPositioner.proxyToSourceMapping(), expectedProxy2SourceScreen1); | 270 | verifyMapping(secondPositioner.proxyToSourceMapping(), expectedProxy2SourceScreen1); | ||
271 | verifyMapping(secondPositioner.sourceToProxyMapping(), expectedSource2ProxyScreen1); | 271 | verifyMapping(secondPositioner.sourceToProxyMapping(), expectedSource2ProxyScreen1); | ||
272 | 272 | | |||
273 | const auto movedItem = m_folderModel->index(1, 0).data(FolderModel::UrlRole).toString(); | 273 | const auto movedItem = m_folderModel->index(1, 0).data(FolderModel::UrlRole).toUrl(); | ||
274 | 274 | | |||
275 | // move the item 1 from source (now in position 2) to the second screen | 275 | // move the item 1 from source (now in position 2) to the second screen | ||
276 | screenMapper->addMapping(movedItem, 1); | 276 | screenMapper->addMapping(movedItem, 1); | ||
277 | 277 | | |||
278 | expectedProxy2SourceScreen1[0] = 0; | 278 | expectedProxy2SourceScreen1[0] = 0; | ||
279 | expectedSource2ProxyScreen1[0] = 0; | 279 | expectedSource2ProxyScreen1[0] = 0; | ||
280 | expectedSource2ProxyScreen0.clear(); | 280 | expectedSource2ProxyScreen0.clear(); | ||
281 | expectedProxy2SourceScreen0.clear(); | 281 | expectedProxy2SourceScreen0.clear(); | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |
I don't think that it used in this file.