From a9c022f5b9670428e6007cc7b638e6041d41611a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Wed, 3 Jul 2013 05:12:30 +0200 Subject: [PATCH] Cleanups --- src/declarativeimports/core/datamodel.cpp | 9 +++------ src/declarativeimports/core/datasource.cpp | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/declarativeimports/core/datamodel.cpp b/src/declarativeimports/core/datamodel.cpp index b88484537..fcd6ed71f 100644 --- a/src/declarativeimports/core/datamodel.cpp +++ b/src/declarativeimports/core/datamodel.cpp @@ -436,11 +436,8 @@ QVariant DataModel::data(const QModelIndex &index, int role) const //is it the reserved role: DataEngineSource ? //also, if each source is an item DataEngineSource is a role between all the others, otherwise we know it from the role variable - //finally, sub items are some times QVariantMap some times QVariantMaps if (!m_keyRoleFilter.isEmpty() && m_roleNames.value(role) == "DataEngineSource") { return source; - } else if (m_items.value(source).value(actualRow).canConvert()) { - return m_items.value(source).value(actualRow).value().value(m_roleNames.value(role)); } else { return m_items.value(source).value(actualRow).value().value(m_roleNames.value(role)); } @@ -494,14 +491,14 @@ int DataModel::columnCount(const QModelIndex &parent) const QVariantMap DataModel::get(int row) const { QModelIndex idx = index(row, 0); - QVariantMap hash; + QVariantMap map; QHash::const_iterator i; for (i = roleNames().constBegin(); i != roleNames().constEnd(); ++i) { - hash[i.value()] = data(idx, i.key()); + map[i.value()] = data(idx, i.key()); } - return hash; + return map; } int DataModel::roleNameToId(const QString &name) diff --git a/src/declarativeimports/core/datasource.cpp b/src/declarativeimports/core/datasource.cpp index 929900fd4..158f9de3a 100644 --- a/src/declarativeimports/core/datasource.cpp +++ b/src/declarativeimports/core/datasource.cpp @@ -141,8 +141,6 @@ void DataSource::dataUpdated(const QString &sourceName, const Plasma::DataEngine //it can arrive also data we don't explicitly connected a source if (m_connectedSources.contains(sourceName)) { m_data.insert(sourceName.toLatin1(), data); - - qDebug() << " new data: " << sourceName; //<< m_data[sourceName.toLatin1()]; emit dataChanged(); emit newData(sourceName, data); } else if (m_dataEngine) {