D27188: KCM Notifications : Manage app-specific notifications with KCconfigXT's magic

Kai Uwe Broulik noreply at phabricator.kde.org
Thu Apr 23 16:19:24 BST 2020


broulik accepted this revision.
broulik added a comment.


  Clean up those minor comments and then ship it, thanks!

INLINE COMMENTS

> kcm.cpp:256
> +    }
> +    return m_behaviorSettingsList[index.row()];
> +}

`.value(index.row())`

> kcm.cpp:269
> +        QString groupName;
> +        QModelIndex index;
> +        for (int i = 0; i < m_sourcesModel->rowCount(QModelIndex()); ++i) {

Why define outside?

> kcm.cpp:270
> +        QModelIndex index;
> +        for (int i = 0; i < m_sourcesModel->rowCount(QModelIndex()); ++i) {
> +            index = m_sourcesModel->index(i, 0);

`QModelIndex()` should be the default argument for `rowCount()`

> ApplicationConfiguration.qml:46
>  
> -    function behavior() {
> -        if (configColumn.desktopEntry) {
> -            return kcm.settings.applicationBehavior(configColumn.desktopEntry);
> -        } else if (configColumn.notifyRcName) {
> -            return kcm.settings.serviceBehavior(configColumn.notifyRcName);
> -        }
> -        return -1;
> -    }
> -
> -    function setBehavior(flag, enable) {
> -        var newBehavior = behavior();
> -        if (enable) {
> -            newBehavior |= flag;
> -        } else {
> -            newBehavior &= ~flag;
> -        }
> -
> -        if (configColumn.desktopEntry) {
> -            return kcm.settings.setApplicationBehavior(configColumn.desktopEntry, newBehavior);
> -        } else if (configColumn.notifyRcName) {
> -            return kcm.settings.setServiceBehavior(configColumn.notifyRcName, newBehavior);
> -        }
> -    }
> +    readonly property bool notAppOther: configColumn.desktopEntry !== configColumn.otherAppsId
>  

Can we swap that around to be "isOtherApp"

REPOSITORY
  R119 Plasma Desktop

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

To: crossi, #plasma, ervin, broulik, bport, meven
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200423/59df2e14/attachment.html>


More information about the Plasma-devel mailing list