]>
cloud.milkyroute.net Git - dolphin.git/blob - src/settings/servicemodel.h
2 * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
10 #include <QAbstractListModel>
14 * @brief Provides a simple model for enabling/disabling services
16 * The following roles are supported:
17 * - Qt::DisplayRole: Name of the service
18 * - Qt::DecorationRole: Icon name of the service
19 * - Qt::CheckStateRole: Specifies whether the service is enabled
20 * - ServiceModel::DesktopEntryNameRole: Name of the desktop-entry of the service
21 * - ServiceModel::Configurable: Specifies whether the service is configurable by the user
23 class ServiceModel
: public QAbstractListModel
30 DesktopEntryNameRole
= Qt::UserRole
,
34 explicit ServiceModel(QObject
* parent
= nullptr);
35 ~ServiceModel() override
;
37 bool insertRows(int row
, int count
, const QModelIndex
& parent
= QModelIndex()) override
;
38 bool setData(const QModelIndex
& index
, const QVariant
& value
, int role
= Qt::EditRole
) override
;
39 QVariant
data(const QModelIndex
& index
, int role
= Qt::DisplayRole
) const override
;
40 int rowCount(const QModelIndex
& parent
= QModelIndex()) const override
;
50 QString desktopEntryName
;
53 QList
<ServiceItem
> m_items
;