KCMUtils
kpluginmodel.cpp
37 return m_config.readEntry(plugin.pluginId() + QLatin1String("Enabled"), plugin.isEnabledByDefault());
163void KPluginModel::addUnsortablePlugins(const QList<KPluginMetaData> &newPlugins, const QString &categoryLabel)
169bool KPluginModel::moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
179 if (!beginMoveRows(sourceParent, sourceRow, sourceRow + count - 1, destinationParent, isMoveDown ? destinationChild + 1 : destinationChild)) {
189void KPluginModel::addPlugins(const QList<KPluginMetaData> &newPlugins, const QString &categoryLabel)
220 Q_EMIT dataChanged(index(0, 0), index(d->m_plugins.size() - 1, 0), {Roles::EnabledRole, Roles::IsChangeableRole});
CategoryDisplayRole
CategorySortRole
bool isValid() const
QString readEntry(const char *key, const char *aDefault=nullptr) const
QString pluginId() const
bool value(QStringView key, bool defaultValue) const
QJsonObject rawData() const
QString iconName() const
QString name() const
static KPluginMetaData findPluginById(const QString &directory, const QString &pluginId, KPluginMetaDataOptions options={})
bool isEnabledByDefault() const
QString description() const
KPluginMetaData findConfigForPluginId(const QString &pluginId) const
Returns the KPluginMetaData object of the plugin's config module.
Definition kpluginmodel.cpp:250
void addUnsortablePlugins(const QList< KPluginMetaData > &plugins, const QString &categoryLabel)
Add plugins that should not be sorted automatically based on their name This is useful in case your a...
Definition kpluginmodel.cpp:163
void load()
Load the enabled state of the plugins from the config group set by setConfig.
Definition kpluginmodel.cpp:260
Q_SIGNAL void isSaveNeededChanged()
Emitted when isSaveNeeded is changed.
void addPlugins(const QList< KPluginMetaData > &plugins, const QString &categoryLabel)
Append plugins to the model.
Definition kpluginmodel.cpp:189
void defaults()
Reset the enabled state of the plugins to its defaults.
Definition kpluginmodel.cpp:270
Q_SIGNAL void defaulted(bool isDefaulted)
Emitted when the enabled state matches the default changes.
void removePlugin(const KPluginMetaData &data)
Definition kpluginmodel.cpp:205
void setConfig(const KConfigGroup &config)
Set the KConfigGroup that is used to load/save the enabled state.
Definition kpluginmodel.cpp:215
bool isSaveNeeded()
Whether or not there are unsaved changes to the enabled state of the plugins.
Definition kpluginmodel.cpp:289
void save()
Save the enabled state of the plugins to the config group set by setConfig.
Definition kpluginmodel.cpp:238
void beginInsertRows(const QModelIndex &parent, int first, int last)
bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
void beginRemoveRows(const QModelIndex &parent, int first, int last)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void endInsertRows()
void endMoveRows()
void endRemoveRows()
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
const_iterator constEnd() const const
const_iterator constFind(const Key &key) const const
iterator begin()
const_iterator cbegin() const const
const_iterator cend() const const
iterator end()
qsizetype size() const const
bool isValid() const const
int row() const const
Q_EMITQ_EMIT
fileName
bool isEmpty() const const
qsizetype lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const const
QString left(qsizetype n) const const
QString mid(qsizetype position, qsizetype n) const const
QVariant fromValue(T &&value)
bool toBool() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.