7#include "providersmodel.h"
13class ProvidersModelPrivate
15 ProvidersModel *
const q;
18 explicit ProvidersModelPrivate(ProvidersModel *qq)
23 EngineBase *getEngine()
const;
24 void setEngine(EngineBase *engine);
26 EngineBase *engine =
nullptr;
30EngineBase *ProvidersModelPrivate::getEngine()
const
35void ProvidersModelPrivate::setEngine(EngineBase *engine)
42 , d(new ProvidersModelPrivate(this))
46ProvidersModel::~ProvidersModel() =
default;
53 {VersionRole,
"version"},
54 {WebsiteRole,
"website"},
56 {ContactEmailRole,
"contactEmail"},
57 {SupportsSslRole,
"supportsSsl"},
59 {ObjectRole,
"object"},
64int KNSCore::ProvidersModel::rowCount(
const QModelIndex &parent)
const
69 return d->knownProviders.count();
74 if (checkIndex(index) && d->engine) {
79 return provider->id();
81 return provider->name();
83 return provider->version();
85 return provider->website();
87 return provider->host();
88 case ContactEmailRole:
89 return provider->contactEmail();
91 return provider->supportsSsl();
93 return provider->icon();
102QObject *KNSCore::ProvidersModel::engine()
const
107void KNSCore::ProvidersModel::setEngine(
QObject *engine)
109 if (d->engine != engine) {
111 d->engine->disconnect(
this);
113 d->engine = qobject_cast<EngineBase *>(engine);
114 Q_EMIT engineChanged();
118 d->knownProviders = d->engine->providerIDs();
122 d->knownProviders = d->engine->providerIDs();
130#include "moc_providersmodel.cpp"
void providersChanged()
Fired whenever the list of providers changes.
ProvidersModel(QObject *parent=nullptr)
The Engine for which this model displays Providers.
bool isValid() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QVariant fromValue(T &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:13:34 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.