From a60d6db013b6fb5e0cea0238e01e272ade66827f Mon Sep 17 00:00:00 2001 From: Viranch Mehta Date: Sat, 16 Jun 2012 20:10:08 +0530 Subject: [PATCH] Fix sourceFilter in QML DataModel to actually filter the sources of the dataengine The sources were not getting filtered due to an error in the loop that added all the sources in any case REVIEW: 105267 --- declarativeimports/core/datamodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/declarativeimports/core/datamodel.cpp b/declarativeimports/core/datamodel.cpp index 9400dbe5b..00108b133 100644 --- a/declarativeimports/core/datamodel.cpp +++ b/declarativeimports/core/datamodel.cpp @@ -187,6 +187,10 @@ void DataModel::dataUpdated(const QString &sourceName, const Plasma::DataEngine: QVariantHash::const_iterator i = m_dataSource->data().constBegin(); while (i != m_dataSource->data().constEnd()) { + if (!m_sourceFilter.isEmpty() && m_sourceFilterRE.isValid() && !m_sourceFilterRE.exactMatch(i.key())) { + ++i; + continue; + } QVariant value = i.value(); if (value.isValid() && value.canConvert()) { Plasma::DataEngine::Data data = value.value();