Review Request 124634: Filter applets by formFactor
Mark Gaiser
markg85 at gmail.com
Thu Aug 6 11:51:03 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124634/#review83484
-----------------------------------------------------------
applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp (lines 115 - 125)
<https://git.reviewboard.kde.org/r/124634/#comment57705>
Can't you add this to the loop above? (//First: remove all that are not allowed anymore)
You would only have to add something like:
PlasmoidTask *plasmoidtask = qobject_cast<PlasmoidTask*>(m_tasks[task]);
else if (plasmoidtask) {
KPluginMetaData md = plasmoidtask->pluginInfo().toMetaData();
if (!md.formFactors().contains(m_formFactor)) {
tasksToDelete << task;
}
}
It seems simpler to me and prevents a contains on "tasksToDelete".
I think you can leave out the isEmpty() check as well. (as i left out in the above snippet.
applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp (line 153)
<https://git.reviewboard.kde.org/r/124634/#comment57704>
qCDebug perhaps?
- Mark Gaiser
On aug 5, 2015, 10:35 p.m., Sebastian Kügler wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124634/
> -----------------------------------------------------------
>
> (Updated aug 5, 2015, 10:35 p.m.)
>
>
> Review request for Plasma and Marco Martin.
>
>
> Repository: plasma-workspace
>
>
> Description
> -------
>
> Filter applets by formFactor
>
> This patch allows to filter the loaded Plasmoids by formFactor. It uses
> a property of host, and passes this down to the PlasmoidProtocol, which
> then decides based on formFactor whether or not to show a Plasmoid.
>
> The value for FormFactor can be changed from QML.
>
> This patch requires https://git.reviewboard.kde.org/r/124632/ to work
> correctly, but it won't hide any applet until then. It's safe to use even
> without above patch.
>
> REVIEW:
>
>
> Diffs
> -----
>
> applets/systemtray/package/contents/ui/main.qml 0d01654bb264f79010ef15418e0e4c5498a4661c
> applets/systemtray/plugin/host.h c7ffac7043ac8e668ab582d3508eb4facbe252e8
> applets/systemtray/plugin/host.cpp dfb294a9574685060a80afe9a26665c7f61c15b8
> applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.h 2776c2fa40e05c6c6aa2dcfa31f37033712a4d36
> applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp 66d8a6a48a1ad5bce3fc27e2e83b3a26be3e4f6e
>
> Diff: https://git.reviewboard.kde.org/r/124634/diff/
>
>
> Testing
> -------
>
> Tried "desktop" and "handset" Formfactor to show / hide the mobile battery applet in the systray.
>
>
> Thanks,
>
> Sebastian Kügler
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20150806/9ce7f066/attachment-0001.html>
More information about the Plasma-devel
mailing list