mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-02-12 10:15:54 +00:00
40 lines
904 B
C++
40 lines
904 B
C++
/*
|
|
SPDX-FileCopyrightText: 2008 Alex Merry <alex.merry@kdemail.net>
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-only
|
|
*/
|
|
|
|
#include "placesengine.h"
|
|
|
|
#include <QDebug>
|
|
#include <QIcon>
|
|
#include <QString>
|
|
|
|
#include "placeservice.h"
|
|
#include "placesproxymodel.h"
|
|
|
|
PlacesEngine::PlacesEngine(QObject *parent, const QVariantList &args)
|
|
: Plasma::DataEngine(parent, args)
|
|
{
|
|
m_placesModel = new KFilePlacesModel(this);
|
|
m_proxyModel = new PlacesProxyModel(this, m_placesModel);
|
|
setModel(QStringLiteral("places"), m_proxyModel);
|
|
}
|
|
|
|
PlacesEngine::~PlacesEngine()
|
|
{
|
|
}
|
|
|
|
Plasma::Service *PlacesEngine::serviceForSource(const QString &source)
|
|
{
|
|
if (source == QLatin1String("places")) {
|
|
return new PlaceService(this, m_placesModel);
|
|
}
|
|
|
|
return DataEngine::serviceForSource(source);
|
|
}
|
|
|
|
K_PLUGIN_CLASS_WITH_JSON(PlacesEngine, "plasma-dataengine-places.json")
|
|
|
|
#include "placesengine.moc"
|