Review Request 128181: Remove a lot of duplication between both AppletInterface constructors

Anthony Fieroni bvbfan at abv.bg
Tue Jun 14 10:59:41 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128181/#review96467
-----------------------------------------------------------




src/scriptengines/qml/plasmoid/appletinterface.cpp (line 67)
<https://git.reviewboard.kde.org/r/128181/#comment65164>

    So, this connect and below must be removed? Same connections in newly setupConnections


- Anthony Fieroni


On Юни 14, 2016, 12:03 след обяд, David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128181/
> -----------------------------------------------------------
> 
> (Updated Юни 14, 2016, 12:03 след обяд)
> 
> 
> Review request for KDE Frameworks and Plasma.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> Also the two were slightly out of sync leading to some connections not
> being in each constructor.
> 
> 
> Diffs
> -----
> 
>   src/scriptengines/qml/plasmoid/appletinterface.h 6a64594cd53cecfbc99ad7562706e1a78d60c138 
>   src/scriptengines/qml/plasmoid/appletinterface.cpp df2d642445bdcc81d7fed463cb38c337380ea25b 
> 
> Diff: https://git.reviewboard.kde.org/r/128181/diff/
> 
> 
> Testing
> -------
> 
> previous code.
> 
> 
> FIRST CTOR ONLY  (normal mode)
>     connect(applet(), &Plasma::Applet::contextualActionsAboutToShow,
>             this, &AppletInterface::contextualActionsAboutToShow);
> 
>     connect(applet(), &Plasma::Applet::activated,
>             this, &AppletInterface::activated);
> 
> 
>     connect(this, &AppletInterface::expandedChanged, [=](bool expanded) {
>         //if both compactRepresentationItem and fullRepresentationItem exist,
>         //the applet is in a popup
>         if (expanded) {
>             if (compactRepresentationItem() && fullRepresentationItem() &&
>                 fullRepresentationItem()->window() && compactRepresentationItem()->window() &&
>                 fullRepresentationItem()->window() != compactRepresentationItem()->window() &&
>                 fullRepresentationItem()->parentItem()) {
>                 fullRepresentationItem()->parentItem()->installEventFilter(this);
>             } else if (fullRepresentationItem() && fullRepresentationItem()->parentItem()) {
>                 fullRepresentationItem()->parentItem()->removeEventFilter(this);
>             }
>         }
>     });
> }
> 
> SECOND CTOR ONLY (special comic applet path)
> 
>     connect(applet(), &Plasma::Applet::configurationRequiredChanged,
>             this, [this](bool needsConfig, const QString &reason) {
>                 emit configurationRequiredChanged();
>                 emit configurationRequiredReasonChanged();
>             });
> 
>     }
> 
> DUPLICATED:
>     qmlRegisterType<QAction>();
> 
>     connect(this, &AppletInterface::configNeedsSaving,
>             applet(), &Plasma::Applet::configNeedsSaving);
>     connect(applet(), &Plasma::Applet::immutabilityChanged,
>             this, &AppletInterface::immutabilityChanged);
> 
>     connect(applet(), &Plasma::Applet::userConfiguringChanged,
>             this, &AppletInterface::userConfiguringChanged);
> 
>     connect(applet(), &Plasma::Applet::statusChanged,
>             this, &AppletInterface::statusChanged);
> 
>     connect(applet(), &Plasma::Applet::destroyedChanged,
>             this, &AppletInterface::destroyedChanged);
> 
> 
>     connect(applet(), &Plasma::Applet::titleChanged,
>             this, &AppletInterface::titleChanged);
> 
>     connect(applet(), &Plasma::Applet::iconChanged,
>             this, &AppletInterface::iconChanged);
> 
>     connect(applet(), &Plasma::Applet::busyChanged,
>             this, &AppletInterface::busyChanged);
> 
>     connect(appletScript(), &DeclarativeAppletScript::formFactorChanged,
>             this, &AppletInterface::formFactorChanged);
>     connect(appletScript(), &DeclarativeAppletScript::locationChanged,
>             this, &AppletInterface::locationChanged);
>     connect(appletScript(), &DeclarativeAppletScript::contextChanged,
>             this, &AppletInterface::contextChanged);
> 
>     if (applet()->containment()) {
>         connect(applet()->containment(), &Plasma::Containment::screenChanged,
>         this, &ContainmentInterface::screenChanged);
>     }
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160614/e6841119/attachment.html>


More information about the Plasma-devel mailing list