Changeset View
Changeset View
Standalone View
Standalone View
tests/pluginloadtest.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 42 | PluginLoadTest() { | |||
---|---|---|---|---|---|
43 | QStandardPaths::setTestModeEnabled(true); | 43 | QStandardPaths::setTestModeEnabled(true); | ||
44 | mDaemon = new TestDaemon; | 44 | mDaemon = new TestDaemon; | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | private Q_SLOTS: | 47 | private Q_SLOTS: | ||
48 | void testPlugins() { | 48 | void testPlugins() { | ||
49 | Device* d = nullptr; | 49 | Device* d = nullptr; | ||
50 | mDaemon->acquireDiscoveryMode(QStringLiteral("plugintest")); | 50 | mDaemon->acquireDiscoveryMode(QStringLiteral("plugintest")); | ||
51 | Q_FOREACH(Device* id, mDaemon->devicesList()) { | 51 | const QList<Device*> devicesList = mDaemon->devicesList(); | ||
52 | for (Device* id : devicesList) { | ||||
52 | if (id->isReachable()) { | 53 | if (id->isReachable()) { | ||
53 | if (!id->isTrusted()) | 54 | if (!id->isTrusted()) | ||
54 | id->requestPair(); | 55 | id->requestPair(); | ||
55 | d = id; | 56 | d = id; | ||
56 | break; | 57 | break; | ||
57 | } | 58 | } | ||
58 | } | 59 | } | ||
59 | mDaemon->releaseDiscoveryMode(QStringLiteral("plugintest")); | 60 | mDaemon->releaseDiscoveryMode(QStringLiteral("plugintest")); | ||
Show All 25 Lines |