From 4c79f8fcffedf03bc5d0b35587032398fd663737 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 28 Aug 2013 22:11:55 +0200 Subject: [PATCH] fix datamodel (adapt to api change) also, change some connects to the new syntax, so next time a thing like that gets catched --- src/declarativeimports/core/datamodel.cpp | 12 +++++++----- src/declarativeimports/core/datamodel.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/declarativeimports/core/datamodel.cpp b/src/declarativeimports/core/datamodel.cpp index 7b59525e1..ef68a6eca 100644 --- a/src/declarativeimports/core/datamodel.cpp +++ b/src/declarativeimports/core/datamodel.cpp @@ -188,7 +188,7 @@ DataModel::~DataModel() { } -void DataModel::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data) +void DataModel::dataUpdated(const QString &sourceName, const QVariantMap &data) { if (!m_sourceFilter.isEmpty() && m_sourceFilterRE.isValid() && !m_sourceFilterRE.exactMatch(sourceName)) { return; @@ -259,10 +259,12 @@ void DataModel::setDataSource(QObject *object) ++i; } - connect(m_dataSource, SIGNAL(newData(const QString &, const Plasma::DataEngine::Data &)), - this, SLOT(dataUpdated(const QString &, const Plasma::DataEngine::Data &))); - connect(m_dataSource, SIGNAL(sourceRemoved(const QString &)), this, SLOT(removeSource(const QString &))); - connect(m_dataSource, SIGNAL(sourceDisconnected(const QString &)), this, SLOT(removeSource(const QString &))); + connect(m_dataSource, &DataSource::newData, + this, &DataModel::dataUpdated); + connect(m_dataSource, &DataSource::sourceRemoved, + this, &DataModel::removeSource); + connect(m_dataSource, &DataSource::sourceDisconnected, + this, &DataModel::removeSource); } QObject *DataModel::dataSource() const diff --git a/src/declarativeimports/core/datamodel.h b/src/declarativeimports/core/datamodel.h index 1dd14c457..168aa7aa1 100644 --- a/src/declarativeimports/core/datamodel.h +++ b/src/declarativeimports/core/datamodel.h @@ -196,7 +196,7 @@ Q_SIGNALS: void filterRegExpChanged(const QString &); private Q_SLOTS: - void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data); + void dataUpdated(const QString &sourceName, const QVariantMap &data); void removeSource(const QString &sourceName); private: