broulik added inline comments.
INLINE COMMENTS
> taskmanager.cpp:23
> +
> +#include <QDebug>
> +#include <QGuiApplication>
Unused
> taskmanager.cpp:58
> + const QModelIndex index = m_model->index(i, 0, QModelIndex());
> + if
> (!index.data(TaskManager::AbstractTasksModel::IsWindow).toBool()) {
> + continue;
`attachPidToTMIndex` already checks for `IsWindow` unless you want to save a
pointless `AppPid` call
> taskmanager.cpp:72
> + if (m_model->rowCount() > 0) {
> + updateRows(0, m_model->rowCount());
> + }
`rowCount() - 1` because you go `i <= last`
> taskmanager.cpp:77
> + connect(m_model, &QAbstractItemModel::dataChanged, this,
> [updateRows](const QModelIndex &topLeft, const QModelIndex &bottomRight,
> const QVector<int> &roles ) {
> + if (roles.contains(Qt::DisplayRole)) {
> + updateRows(topLeft.row(), bottomRight.row());
Roles can potentially be empty indicating all roles are dirty?
Also, what about `DecorationRole`, in case it's window pixmap.
> taskmanager.cpp:83
> + if (m_model->rowCount() > 0) {
> + updateRows(0, m_model->rowCount());
> + }
`rowCount() - 1`
> taskmanager.cpp:99
> + m_titleAttribute->setData(process, index.data(Qt::DisplayRole));
> + m_iconNameAttribute->setData(process, index.data(Qt::DecorationRole));
> +}
This role is a `QIcon`, potentially created from the window pixmap in case
window mapping failed.
Or is that what the "tiny mods in ProcessModel" is about?
> taskmanager.h:24
> +#include <processcore/process_data_provider.h>
> +#include <QModelIndex>
> +
Unused, forward-declare
REPOSITORY
R106 KSysguard
REVISION DETAIL
https://phabricator.kde.org/D23356
To: davidedmundson, #plasma
Cc: broulik, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas,
GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed,
jensreuterberg, abetts, sebas, apol, mart