Plasma5Support

placesengine.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Alex Merry <alex.merry@kdemail.net>
3
4 SPDX-License-Identifier: LGPL-2.0-only
5*/
6
7#include "placesengine.h"
8
9#include <QDebug>
10#include <QIcon>
11#include <QString>
12
13#include "placeservice.h"
14#include "placesproxymodel.h"
15
16PlacesEngine::PlacesEngine(QObject *parent)
17 : Plasma5Support::DataEngine(parent)
18{
19 m_placesModel = new KFilePlacesModel(this);
20 m_proxyModel = new PlacesProxyModel(this, m_placesModel);
21 setModel(QStringLiteral("places"), m_proxyModel);
22}
23
24PlacesEngine::~PlacesEngine()
25{
26}
27
28Plasma5Support::Service *PlacesEngine::serviceForSource(const QString &source)
29{
30 if (source == QLatin1String("places")) {
31 return new PlaceService(this, m_placesModel);
32 }
33
34 return DataEngine::serviceForSource(source);
35}
36
37K_PLUGIN_CLASS_WITH_JSON(PlacesEngine, "plasma-dataengine-places.json")
38
39#include "placesengine.moc"
#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile)
This class provides a generic API for write access to settings or services.
Definition service.h:78
Namespace for everything in libplasma.
Definition datamodel.cpp:15
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.