kde-workspace/plasma/dataengines/geolocation/geolocationprovider.cpp

62 lines
1.6 KiB
C++
Raw Normal View History

2014-11-13 19:30:51 +02:00
/*
* Copyright (C) 2009 Aaron Seigo <aseigo@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "geolocationprovider.h"
#include <kdebug.h>
2014-11-13 19:30:51 +02:00
GeolocationProvider::GeolocationProvider(QObject *parent, const QVariantList &args)
: QObject(parent),
m_sharedData(nullptr),
2014-11-13 19:30:51 +02:00
m_updating(false)
{
Q_UNUSED(args);
2014-11-13 19:30:51 +02:00
}
void GeolocationProvider::init(Plasma::DataEngine::Data *data)
2014-11-13 19:30:51 +02:00
{
m_sharedData = data;
}
void GeolocationProvider::requestUpdate()
2014-11-13 19:30:51 +02:00
{
if (!m_updating) {
2014-11-13 19:30:51 +02:00
m_updating = true;
update();
}
}
bool GeolocationProvider::isUpdating() const
2014-11-13 19:30:51 +02:00
{
return m_updating;
2014-11-13 19:30:51 +02:00
}
void GeolocationProvider::setData(const Plasma::DataEngine::Data &data)
{
m_updating = false;
const QString providername = objectName();
m_sharedData->insert(providername, data);
// qDebug() << Q_FUNC_INFO << providername << m_updating << << data;
emit updated();
2014-11-13 19:30:51 +02:00
}
void GeolocationProvider::update()
{
}
2015-02-27 09:28:46 +00:00
#include "moc_geolocationprovider.cpp"