Changeset View
Changeset View
Standalone View
Standalone View
shell/shellcorona.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | 42 | | |||
43 | #include <kactivities/controller.h> | 43 | #include <kactivities/controller.h> | ||
44 | #include <kactivities/consumer.h> | 44 | #include <kactivities/consumer.h> | ||
45 | #include <ksycoca.h> | 45 | #include <ksycoca.h> | ||
46 | #include <KGlobalAccel> | 46 | #include <KGlobalAccel> | ||
47 | #include <KAuthorized> | 47 | #include <KAuthorized> | ||
48 | #include <KWindowSystem> | 48 | #include <KWindowSystem> | ||
49 | #include <kdeclarative/kdeclarative.h> | 49 | #include <kdeclarative/kdeclarative.h> | ||
50 | #include <kdeclarative/qmlobject.h> | 50 | #include <kdeclarative/qmlobjectsharedengine.h> | ||
51 | #include <KMessageBox> | 51 | #include <KMessageBox> | ||
52 | #include <kdirwatch.h> | 52 | #include <kdirwatch.h> | ||
53 | 53 | | |||
54 | #include <KPackage/PackageLoader> | 54 | #include <KPackage/PackageLoader> | ||
55 | 55 | | |||
56 | #include <KWayland/Client/connection_thread.h> | 56 | #include <KWayland/Client/connection_thread.h> | ||
57 | #include <KWayland/Client/registry.h> | 57 | #include <KWayland/Client/registry.h> | ||
58 | #include <KWayland/Client/plasmashell.h> | 58 | #include <KWayland/Client/plasmashell.h> | ||
▲ Show 20 Lines • Show All 751 Lines • ▼ Show 20 Line(s) | |||||
810 | 810 | | |||
811 | void ShellCorona::showAlternativesForApplet(Plasma::Applet *applet) | 811 | void ShellCorona::showAlternativesForApplet(Plasma::Applet *applet) | ||
812 | { | 812 | { | ||
813 | const QUrl alternativesQML = kPackage().fileUrl("appletalternativesui"); | 813 | const QUrl alternativesQML = kPackage().fileUrl("appletalternativesui"); | ||
814 | if (alternativesQML.isEmpty()) { | 814 | if (alternativesQML.isEmpty()) { | ||
815 | return; | 815 | return; | ||
816 | } | 816 | } | ||
817 | 817 | | |||
818 | KDeclarative::QmlObject *qmlObj = new KDeclarative::QmlObject(this); | 818 | auto *qmlObj = new KDeclarative::QmlObjectSharedEngine(this); | ||
819 | qmlObj->setInitializationDelayed(true); | 819 | qmlObj->setInitializationDelayed(true); | ||
820 | qmlObj->setSource(alternativesQML); | 820 | qmlObj->setSource(alternativesQML); | ||
821 | 821 | | |||
822 | AlternativesHelper *helper = new AlternativesHelper(applet, qmlObj); | 822 | AlternativesHelper *helper = new AlternativesHelper(applet, qmlObj); | ||
823 | qmlObj->rootContext()->setContextProperty(QStringLiteral("alternativesHelper"), helper); | 823 | qmlObj->rootContext()->setContextProperty(QStringLiteral("alternativesHelper"), helper); | ||
824 | 824 | | |||
825 | qmlObj->completeInitialization(); | 825 | qmlObj->completeInitialization(); | ||
826 | 826 | | |||
▲ Show 20 Lines • Show All 582 Lines • ▼ Show 20 Line(s) | 1404 | { | |||
1409 | } | 1409 | } | ||
1410 | 1410 | | |||
1411 | if (!m_interactiveConsole) { | 1411 | if (!m_interactiveConsole) { | ||
1412 | const QUrl consoleQML = kPackage().fileUrl("interactiveconsole"); | 1412 | const QUrl consoleQML = kPackage().fileUrl("interactiveconsole"); | ||
1413 | if (consoleQML.isEmpty()) { | 1413 | if (consoleQML.isEmpty()) { | ||
1414 | return; | 1414 | return; | ||
1415 | } | 1415 | } | ||
1416 | 1416 | | |||
1417 | m_interactiveConsole = new KDeclarative::QmlObject(this); | 1417 | m_interactiveConsole = new KDeclarative::QmlObjectSharedEngine(this); | ||
1418 | m_interactiveConsole->setInitializationDelayed(true); | 1418 | m_interactiveConsole->setInitializationDelayed(true); | ||
1419 | m_interactiveConsole->setSource(consoleQML); | 1419 | m_interactiveConsole->setSource(consoleQML); | ||
1420 | 1420 | | |||
1421 | QObject *engine = new WorkspaceScripting::ScriptEngine(this, m_interactiveConsole); | 1421 | QObject *engine = new WorkspaceScripting::ScriptEngine(this, m_interactiveConsole); | ||
1422 | m_interactiveConsole->rootContext()->setContextProperty(QStringLiteral("scriptEngine"), engine); | 1422 | m_interactiveConsole->rootContext()->setContextProperty(QStringLiteral("scriptEngine"), engine); | ||
1423 | 1423 | | |||
1424 | m_interactiveConsole->completeInitialization(); | 1424 | m_interactiveConsole->completeInitialization(); | ||
1425 | if (m_interactiveConsole->rootObject()) { | 1425 | if (m_interactiveConsole->rootObject()) { | ||
▲ Show 20 Lines • Show All 718 Lines • Show Last 20 Lines |