Changeset View
Changeset View
Standalone View
Standalone View
shell/osd.cpp
Show All 20 Lines | |||||
21 | 21 | | |||
22 | #include <QDBusConnection> | 22 | #include <QDBusConnection> | ||
23 | #include <QTimer> | 23 | #include <QTimer> | ||
24 | #include <QWindow> | 24 | #include <QWindow> | ||
25 | #include <QDebug> | 25 | #include <QDebug> | ||
26 | #include <QUrl> | 26 | #include <QUrl> | ||
27 | 27 | | |||
28 | #include <Plasma/Package> | 28 | #include <Plasma/Package> | ||
29 | #include <KDeclarative/QmlObject> | 29 | #include <KDeclarative/QmlObjectSharedEngine> | ||
30 | #include <klocalizedstring.h> | 30 | #include <klocalizedstring.h> | ||
31 | 31 | | |||
32 | Osd::Osd(KSharedConfig::Ptr config, ShellCorona *corona) | 32 | Osd::Osd(KSharedConfig::Ptr config, ShellCorona *corona) | ||
33 | : QObject(corona) | 33 | : QObject(corona) | ||
34 | , m_osdUrl(corona->lookAndFeelPackage().fileUrl("osdmainscript")) | 34 | , m_osdUrl(corona->lookAndFeelPackage().fileUrl("osdmainscript")) | ||
35 | , m_config(config) | 35 | , m_config(config) | ||
36 | { | 36 | { | ||
37 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/osdService"), this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals); | 37 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/osdService"), this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals); | ||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 161 | if (m_osdObject && m_osdObject->rootObject()) { | |||
162 | return true; | 162 | return true; | ||
163 | } | 163 | } | ||
164 | 164 | | |||
165 | if (m_osdUrl.isEmpty()) { | 165 | if (m_osdUrl.isEmpty()) { | ||
166 | return false; | 166 | return false; | ||
167 | } | 167 | } | ||
168 | 168 | | |||
169 | if (!m_osdObject) { | 169 | if (!m_osdObject) { | ||
170 | m_osdObject = new KDeclarative::QmlObject(this); | 170 | m_osdObject = new KDeclarative::QmlObjectSharedEngine(this); | ||
171 | } | 171 | } | ||
172 | 172 | | |||
173 | m_osdObject->setSource(m_osdUrl); | 173 | m_osdObject->setSource(m_osdUrl); | ||
174 | 174 | | |||
175 | if (m_osdObject->status() != QQmlComponent::Ready) { | 175 | if (m_osdObject->status() != QQmlComponent::Ready) { | ||
176 | qWarning() << "Failed to load OSD QML file" << m_osdUrl; | 176 | qWarning() << "Failed to load OSD QML file" << m_osdUrl; | ||
177 | return false; | 177 | return false; | ||
178 | } | 178 | } | ||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |