KNewStuff
core/commentsmodel.cpp
42 // Sanity checks, because we need a few things to be correct before we can actually fetch comments...
44 qCWarning(KNEWSTUFFCORE) << "CommentsModel must be parented on a KNSCore::Engine instance to be able to fetch comments";
47 qCWarning(KNEWSTUFFCORE) << "Without an entry to fetch comments for, CommentsModel cannot fetch comments for it";
56 q->connect(provider.data(), &Provider::commentsLoaded, q, [=](const QList<std::shared_ptr<KNSCore::Comment>> &newComments){
72 q->beginInsertRows(QModelIndex(), comments.count(), comments.count() + actualNewComments.count() - 1);
82 qCDebug(KNEWSTUFFCORE) << "Loading comments, page" << pageToLoad << "with current comment count" << comments.count() << "out of a total of" << entry.numberOfComments();
168 value.setValue(i18nc("The value returned for an unknown role when requesting data from the model.", "Unknown CommentsModel role"));
void clear()
NoOption
bool checkIndex(const QModelIndex &index, QAbstractItemModel::CheckIndexOptions options) const const
CommentsModel(Engine *parent=nullptr)
Construct a new CommentsModel instance.
Definition: core/commentsmodel.cpp:89
Contains the core functionality for handling interaction with NewStuff providers. ...
Definition: atticaprovider.cpp:27
KNSCore::EntryInternal entry
The Entry for which this model should handle comments.
Definition: core/commentsmodel.h:48
bool isValid() const const
int count(const T &value) const const
void append(const T &value)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
int row() const const
void commentsLoaded(const QList< std::shared_ptr< KNSCore::Comment >> comments)
Fired when new comments have been loaded.
void setValue(const T &value)
QObject * parent() const const
Q_EMITQ_EMIT
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 18 2021 22:43:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 18 2021 22:43:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.