D25220: KCM Style : kcm state is handled by ManagedConfigModule, properties are bound to settings, making it a bit simpler.

Kevin Ottens noreply at phabricator.kde.org
Tue Nov 12 10:54:50 GMT 2019


ervin added inline comments.

INLINE COMMENTS

> kcmstyle.cpp:98
>  
> -    connect(m_model, &StylesModel::selectedStyleChanged, this, [this] {
> -        m_selectedStyleDirty = true;
> -        setNeedsSave(true);
> +    connect(m_model, &StylesModel::selectedStyleChanged, this, [this](const QString& style) {
> +        m_settings->setWidgetStyle(style);

Space before &, not after.

> kcmstyle.cpp:245
>  {
> -    if (!m_selectedStyleDirty && !m_effectsDirty) {
> -        return;

AFAICT this is the only place where m_effectsDirty is read. So I think you can remove that flag altogether, which should bring further simplifications.

> kcmstyle.cpp:248
>      bool newStyleLoaded = false;
> -    if (m_selectedStyleDirty) {
> +    if (m_model->selectedStyle() != m_previousStyle) {
>          QScopedPointer<QStyle> newStyle(QStyleFactory::create(m_model->selectedStyle()));

Are you sure you need this m_previousStyle? I'd expect it to be exactly m_settings->widgetStyle().

REPOSITORY
  R119 Plasma Desktop

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

To: crossi, #plasma, ervin, bport, mart, broulik
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, 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/20191112/7eddfd3a/attachment.html>


More information about the Plasma-devel mailing list