scripting: Add localized context to the shared QML engine
This commit is contained in:
parent
90a71553c3
commit
010a8a1e13
1 changed files with 2 additions and 0 deletions
|
@ -34,6 +34,7 @@
|
||||||
// KDE
|
// KDE
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
#include <KGlobalAccel>
|
#include <KGlobalAccel>
|
||||||
|
#include <KLocalizedContext>
|
||||||
#include <KPackage/PackageLoader>
|
#include <KPackage/PackageLoader>
|
||||||
// Qt
|
// Qt
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
|
@ -626,6 +627,7 @@ KWin::Scripting::Scripting(QObject *parent)
|
||||||
, m_workspaceWrapper(new QtScriptWorkspaceWrapper(this))
|
, m_workspaceWrapper(new QtScriptWorkspaceWrapper(this))
|
||||||
{
|
{
|
||||||
m_qmlEngine->setProperty("_kirigamiTheme", QStringLiteral("KirigamiPlasmaStyle"));
|
m_qmlEngine->setProperty("_kirigamiTheme", QStringLiteral("KirigamiPlasmaStyle"));
|
||||||
|
m_qmlEngine->rootContext()->setContextObject(new KLocalizedContext(m_qmlEngine));
|
||||||
init();
|
init();
|
||||||
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Scripting"), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Scripting"), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
||||||
connect(Workspace::self(), &Workspace::configChanged, this, &Scripting::start);
|
connect(Workspace::self(), &Workspace::configChanged, this, &Scripting::start);
|
||||||
|
|
Loading…
Reference in a new issue