Changeset View
Changeset View
Standalone View
Standalone View
shell/coronatesthelper.cpp
Show All 27 Lines | 26 | CoronaTestHelper::CoronaTestHelper(Corona* parent) | |||
---|---|---|---|---|---|
28 | , m_corona(parent) | 28 | , m_corona(parent) | ||
29 | , m_exitcode(0) | 29 | , m_exitcode(0) | ||
30 | { | 30 | { | ||
31 | connect(m_corona, &Corona::startupCompleted, this, &CoronaTestHelper::initialize); | 31 | connect(m_corona, &Corona::startupCompleted, this, &CoronaTestHelper::initialize); | ||
32 | } | 32 | } | ||
33 | 33 | | |||
34 | void CoronaTestHelper::processContainment(Plasma::Containment* containment) | 34 | void CoronaTestHelper::processContainment(Plasma::Containment* containment) | ||
35 | { | 35 | { | ||
36 | foreach(Plasma::Applet* applet, containment->applets()) { | 36 | const auto applets = containment->applets(); | ||
37 | for (Plasma::Applet* applet : applets) { | ||||
37 | processApplet(applet); | 38 | processApplet(applet); | ||
38 | } | 39 | } | ||
39 | connect(containment, &Plasma::Containment::appletAdded, this, &CoronaTestHelper::processApplet); | 40 | connect(containment, &Plasma::Containment::appletAdded, this, &CoronaTestHelper::processApplet); | ||
40 | } | 41 | } | ||
41 | 42 | | |||
42 | void CoronaTestHelper::processApplet(Plasma::Applet* applet) | 43 | void CoronaTestHelper::processApplet(Plasma::Applet* applet) | ||
43 | { | 44 | { | ||
44 | PlasmaQuick::AppletQuickItem* obj = applet->property("_plasma_graphicObject").value<PlasmaQuick::AppletQuickItem*>(); | 45 | PlasmaQuick::AppletQuickItem* obj = applet->property("_plasma_graphicObject").value<PlasmaQuick::AppletQuickItem*>(); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 88 | { | |||
94 | qCWarning(PLASMASHELL) << "test finished" << testObject << failed << "remaining" << m_tests; | 95 | qCWarning(PLASMASHELL) << "test finished" << testObject << failed << "remaining" << m_tests; | ||
95 | if (m_tests.isEmpty()) { | 96 | if (m_tests.isEmpty()) { | ||
96 | qGuiApp->exit(m_exitcode); | 97 | qGuiApp->exit(m_exitcode); | ||
97 | } | 98 | } | ||
98 | } | 99 | } | ||
99 | 100 | | |||
100 | void CoronaTestHelper::initialize() | 101 | void CoronaTestHelper::initialize() | ||
101 | { | 102 | { | ||
102 | foreach(Plasma::Containment* containment, m_corona->containments()) { | 103 | const auto containments = m_corona->containments(); | ||
104 | for (Plasma::Containment* containment : containments) { | ||||
103 | processContainment(containment); | 105 | processContainment(containment); | ||
104 | } | 106 | } | ||
105 | connect(m_corona, &Corona::containmentAdded, this, &CoronaTestHelper::processContainment); | 107 | connect(m_corona, &Corona::containmentAdded, this, &CoronaTestHelper::processContainment); | ||
106 | 108 | | |||
107 | if (m_tests.isEmpty()) { | 109 | if (m_tests.isEmpty()) { | ||
108 | qCWarning(PLASMASHELL) << "no tests found for the corona" << QCoreApplication::instance()->arguments(); | 110 | qCWarning(PLASMASHELL) << "no tests found for the corona" << QCoreApplication::instance()->arguments(); | ||
109 | qGuiApp->exit(); | 111 | qGuiApp->exit(); | ||
110 | return; | 112 | return; | ||
111 | } | 113 | } | ||
112 | } | 114 | } |