Changeset View
Changeset View
Standalone View
Standalone View
core/daemon.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 68 | { | |||
---|---|---|---|---|---|
85 | for (const QString& id : list) { | 85 | for (const QString& id : list) { | ||
86 | addDevice(new Device(this, id)); | 86 | addDevice(new Device(this, id)); | ||
87 | } | 87 | } | ||
88 | 88 | | |||
89 | //Listen to new devices | 89 | //Listen to new devices | ||
90 | for (LinkProvider* a : qAsConst(d->m_linkProviders)) { | 90 | for (LinkProvider* a : qAsConst(d->m_linkProviders)) { | ||
91 | connect(a, &LinkProvider::onConnectionReceived, | 91 | connect(a, &LinkProvider::onConnectionReceived, | ||
92 | this, &Daemon::onNewDeviceLink); | 92 | this, &Daemon::onNewDeviceLink); | ||
93 | a->onStart(); | 93 | a->onStartedFinishedMutex.lock(); | ||
94 | QMetaObject::invokeMethod(a, "onStart"); | ||||
95 | a->onStartedFinished.wait(&(a->onStartedFinishedMutex)); | ||||
96 | a->onStartedFinishedMutex.unlock(); | ||||
94 | } | 97 | } | ||
95 | 98 | | |||
96 | //Register on DBus | 99 | //Register on DBus | ||
97 | qDBusRegisterMetaType< QMap<QString,QString> >(); | 100 | qDBusRegisterMetaType< QMap<QString,QString> >(); | ||
98 | QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kdeconnect")); | 101 | QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kdeconnect")); | ||
99 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/modules/kdeconnect"), this, QDBusConnection::ExportScriptableContents); | 102 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/modules/kdeconnect"), this, QDBusConnection::ExportScriptableContents); | ||
100 | 103 | | |||
101 | qCDebug(KDECONNECT_CORE) << "KdeConnect daemon started"; | 104 | qCDebug(KDECONNECT_CORE) << "KdeConnect daemon started"; | ||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |