Commit 76cd1fdc authored by Martin Flöser's avatar Martin Flöser
Browse files

[kcmeffects] Do not use root context properties

Apparently it's not allowed to set root context properties multiple
times. If one goes to systemsettings, opens effects kcm, closes it
and opens it again it crashes due to setting a context property with
same name again.

This change eliminates the need for the context property by modifying
the property of the QML objects directly.

BUG: 354164
BUG: 351763
FIXED-IN: 5.4.3
REVIEW: 125737
parent 484e4be7
......@@ -609,8 +609,9 @@ void EffectView::init(ViewType type)
}
QString mainFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, path, QStandardPaths::LocateFile);
setResizeMode(QQuickView::SizeRootObjectToView);
rootContext()->setContextProperty("engine", this);
setSource(QUrl(mainFile));
rootObject()->setProperty("color",
KColorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color());
connect(rootObject(), SIGNAL(changed()), this, SIGNAL(changed()));
setMinimumSize(initialSize());
connect(rootObject(), SIGNAL(implicitWidthChanged()), this, SLOT(slotImplicitSizeChanged()));
......
......@@ -126,8 +126,6 @@ public:
};
EffectView(ViewType type, QWindow *parent = 0);
Q_INVOKABLE QColor backgroundViewColor() { return KColorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color(); };
void save();
void load();
void defaults();
......
......@@ -27,7 +27,6 @@ Rectangle {
signal changed
implicitWidth: col.implicitWidth
implicitHeight: col.implicitHeight
color: engine.backgroundViewColor()
Component {
id: sectionHeading
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment