File indexing completed on 2024-05-19 05:37:51

0001 /*
0002     SPDX-FileCopyrightText: 2008 Alex Merry <alex.merry@kdemail.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #include "placesengine.h"
0008 
0009 #include <QDebug>
0010 #include <QIcon>
0011 #include <QString>
0012 
0013 #include "placeservice.h"
0014 #include "placesproxymodel.h"
0015 
0016 PlacesEngine::PlacesEngine(QObject *parent)
0017     : Plasma5Support::DataEngine(parent)
0018 {
0019     m_placesModel = new KFilePlacesModel(this);
0020     m_proxyModel = new PlacesProxyModel(this, m_placesModel);
0021     setModel(QStringLiteral("places"), m_proxyModel);
0022 }
0023 
0024 PlacesEngine::~PlacesEngine()
0025 {
0026 }
0027 
0028 Plasma5Support::Service *PlacesEngine::serviceForSource(const QString &source)
0029 {
0030     if (source == QLatin1String("places")) {
0031         return new PlaceService(this, m_placesModel);
0032     }
0033 
0034     return DataEngine::serviceForSource(source);
0035 }
0036 
0037 K_PLUGIN_CLASS_WITH_JSON(PlacesEngine, "plasma-dataengine-places.json")
0038 
0039 #include "placesengine.moc"