Moin moin,

I'm hacking on a Plasma::DataEngine which receives its data via a DBus
interface. updateSourceEvent() is thus uninteresting, all updates come
from DBus' propertiesChanged signal.

One of these properties ("Metadata") contains a QVariantMap which I
place in one dataengine source:

void DataEngine::fillMetadata(const QVariantMap& metadata)
{
        const QString source = QLatin1String("metadata");
        removeAllData(source);
        QMapIterator<QString, QVariant> iter(metadata);
        while (iter.hasNext())
        {
                iter.next();
                setData(source, iter.key(), iter.value());
        }
}

Because the available metadata in different situations might not
consist of the same set of keys, removeAllData() clears the source
before filling it with new data. The function above is called both
from the propertiesChanged() slot and from the ctor to initialize the
source. Now when I look at this source in plasmaengineexplorer,
everything's fine until the propertiesChanged signal is delivered for
this property. After that, the source is shown empty in
plasmaengineexplorer when I update it, and that won't change in
further updates.

At first I thought that removeAllData() causes the confusion, so I
changed fillMetadata() like this:

void DataEngine::fillMetadata(const QVariantMap& metadata)
{
        const QString source = QLatin1String("metadata");
        foreach (const QString& key, query(source).keys() + metadata.keys())
                setData(source, key, metadata.value(key));
}

But this causes the same behavior in plasmaengineexplorer. What am I
doing wrong?

Greetings
Stefan

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to