Filter applets by formFactor

Review Request #124634 - Created Aug. 5, 2015 and submitted

Information
Sebastian Kügler
plasma-workspace
Reviewers
plasma
mart

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:

Tried "desktop" and "handset" Formfactor to show / hide the mobile battery applet in the systray.

Issues

  • 1
  • 1
  • 0
  • 2
Description From Last Updated
Can't you add this to the loop above? (//First: remove all that are not allowed anymore) You would only have ... Mark Gaiser Mark Gaiser
Marco Martin
Sebastian Kügler
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 07c46ebe858d471a5660cb5d39cfb12342214100 by Sebastian Kügler to branch master.
Mark Gaiser

   
applets/systemtray/plugin/protocols/plasmoid/plasmoidprotocol.cpp (Diff revision 1)
 
 
 
 
 
 
 
 
 
 
 
 

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.

qCDebug perhaps?

  1. I would even throw it out altogether, it's useful while developing this patch but other than that it will just add not-so-useful noise to plasma output.

  2. I already did before submitting. :)

Loading...