D20237: Port to new KWorkspace API

Kai Uwe Broulik noreply at phabricator.kde.org
Thu Apr 4 20:15:39 BST 2019


broulik added inline comments.

INLINE COMMENTS

> systementry.cpp:26
> +
> +int SystemEntry::s_instanceCount = 0;
> +SessionManagement* SystemEntry::s_sessionManagement = nullptr;

QSharedPointer :P

> systemmodel.cpp:42
> +
> +    for (SystemEntry *entry : m_entries.values()) {
> +        QObject::connect(entry, &SystemEntry::isValidChanged, this,

range-for gives you values already, no need for `values()`

> systemmodel.cpp:45
> +            [this]() {
> +                SystemEntry *entry = qobject_cast<SystemEntry *>(QObject::sender());
> +                const QModelIndex &idx = index((int)entry->action(), 0);

Just capture `entry` into the lambda

> systemmodel.cpp:46
> +                SystemEntry *entry = qobject_cast<SystemEntry *>(QObject::sender());
> +                const QModelIndex &idx = index((int)entry->action(), 0);
> +                emit dataChanged(idx, idx, QVector<int>{Kicker::EnabledRole});

`static_cast`, also everywhere else

> KickoffItem.qml:31
>  
> +    enabed: !(model.enabled === false)
> +

This means we now show all logout options and only disable them if not supported?

REPOSITORY
  R119 Plasma Desktop

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D20237

To: hein, #plasma, davidedmundson
Cc: broulik, apol, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190404/6c1f3215/attachment-0001.html>


More information about the Plasma-devel mailing list