2013-09-04 11:48:06 +02:00
|
|
|
/*
|
2020-08-13 21:08:54 +02:00
|
|
|
SPDX-FileCopyrightText: 2011 Aaron Seigo <aseigo@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
2013-09-04 11:48:06 +02:00
|
|
|
|
|
|
|
#include "dataenginetracker.h"
|
|
|
|
|
2013-09-04 16:42:21 +02:00
|
|
|
#include <QDebug>
|
2021-03-05 19:15:32 +01:00
|
|
|
#include <QTime>
|
2013-09-04 11:48:06 +02:00
|
|
|
|
|
|
|
DataEngineTracker::DataEngineTracker(Plasma::DataEngine *engine, QObject *parent)
|
2021-03-05 19:15:32 +01:00
|
|
|
: QObject(parent)
|
|
|
|
, m_engine(engine)
|
2013-09-04 11:48:06 +02:00
|
|
|
{
|
|
|
|
connect(engine, SIGNAL(sourceAdded(QString)), this, SLOT(sourceAdded(QString)));
|
|
|
|
connect(engine, SIGNAL(sourceRemoved(QString)), this, SLOT(sourceRemoved(QString)));
|
|
|
|
engine->connectAllSources(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DataEngineTracker::dataUpdated(const QString &source, const Plasma::DataEngine::Data &data)
|
|
|
|
{
|
2013-09-04 16:42:21 +02:00
|
|
|
qDebug() << QTime::currentTime() << source;
|
2013-09-04 11:48:06 +02:00
|
|
|
QHashIterator<QString, QVariant> it(data);
|
|
|
|
while (it.hasNext()) {
|
|
|
|
it.next();
|
2013-09-04 16:42:21 +02:00
|
|
|
qDebug() << " " << it.key() << it.value();
|
2013-09-04 11:48:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DataEngineTracker::sourceAdded(const QString &source)
|
|
|
|
{
|
2013-09-04 16:42:21 +02:00
|
|
|
qDebug() << QTime::currentTime() << source;
|
2013-09-04 11:48:06 +02:00
|
|
|
m_engine->connectSource(source, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DataEngineTracker::sourceRemoved(const QString &source)
|
|
|
|
{
|
2013-09-04 16:42:21 +02:00
|
|
|
qDebug() << QTime::currentTime() << source;
|
2013-09-04 11:48:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#include <dataenginetracker.moc>
|