QMetaObject::invokeMethod is called incorrectly in
DataEngine::connectSource / DataEngine::connectAllSources also: If a DataEngine fails to create the source in sourceRequested(source), an empty source is created in d->source(source) and then used during QMetaObject::invokeMethod, which calls updated for the applet. Better: don't create the source. This forces DataEngines to create the source. Patch by Michael Olbrich <michael-olbrich@web.de> svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=695097
This commit is contained in:
parent
f84844f85c
commit
8ccfa4e4dd
@ -140,7 +140,7 @@ void DataEngine::connectSource(const QString& source, QObject* visualization) co
|
|||||||
if (!s) {
|
if (!s) {
|
||||||
// we didn't find a data source, so give the engine an opportunity to make one
|
// we didn't find a data source, so give the engine an opportunity to make one
|
||||||
if (d->sourceRequested(source)) {
|
if (d->sourceRequested(source)) {
|
||||||
s = d->source(source);
|
s = d->source(source, false);
|
||||||
if (s) {
|
if (s) {
|
||||||
// now we have a source; since it was created on demand, assume
|
// now we have a source; since it was created on demand, assume
|
||||||
// it should be removed when not used
|
// it should be removed when not used
|
||||||
@ -155,7 +155,7 @@ void DataEngine::connectSource(const QString& source, QObject* visualization) co
|
|||||||
|
|
||||||
connect(s, SIGNAL(updated(QString,Plasma::DataEngine::Data)),
|
connect(s, SIGNAL(updated(QString,Plasma::DataEngine::Data)),
|
||||||
visualization, SLOT(updated(QString,Plasma::DataEngine::Data)));
|
visualization, SLOT(updated(QString,Plasma::DataEngine::Data)));
|
||||||
QMetaObject::invokeMethod(visualization, SLOT(updated(QString,Plasma::DataEngine::Data)),
|
QMetaObject::invokeMethod(visualization, "updated",
|
||||||
Q_ARG(QString, s->objectName()),
|
Q_ARG(QString, s->objectName()),
|
||||||
Q_ARG(Plasma::DataEngine::Data, s->data()));
|
Q_ARG(Plasma::DataEngine::Data, s->data()));
|
||||||
}
|
}
|
||||||
@ -180,8 +180,7 @@ void DataEngine::connectAllSources(QObject* visualization) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (const DataContainer* s, d->sources) {
|
foreach (const DataContainer* s, d->sources) {
|
||||||
QMetaObject::invokeMethod(visualization,
|
QMetaObject::invokeMethod(visualization, "updated",
|
||||||
SLOT(updated(QString,Plasma::DataEngine::Data)),
|
|
||||||
Q_ARG(QString, s->objectName()),
|
Q_ARG(QString, s->objectName()),
|
||||||
Q_ARG(Plasma::DataEngine::Data, s->data()));
|
Q_ARG(Plasma::DataEngine::Data, s->data()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user