Implement Applet::shouldConserveResources(), a method to help plasmoid developers to know whether they should conserve resources.
Peer reviewed by Chani and Richmoore. CCMAIL:aseigo@kde.org svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=751216
This commit is contained in:
parent
2442ef8da9
commit
e4665a938a
@ -44,6 +44,8 @@
|
||||
#include <KServiceTypeTrader>
|
||||
#include <KIconLoader>
|
||||
|
||||
#include <Solid/PowerManagement>
|
||||
|
||||
#include "plasma/configxml.h"
|
||||
#include "plasma/containment.h"
|
||||
#include "plasma/corona.h"
|
||||
@ -570,6 +572,11 @@ QString Applet::pluginName() const
|
||||
return d->appletDescription.pluginName();
|
||||
}
|
||||
|
||||
bool Applet::shouldConserveResources() const
|
||||
{
|
||||
return Solid::PowerManagement::appShouldConserveResources();
|
||||
}
|
||||
|
||||
QString Applet::category() const
|
||||
{
|
||||
if (!d->appletDescription.isValid()) {
|
||||
|
8
applet.h
8
applet.h
@ -398,6 +398,14 @@ class PLASMA_EXPORT Applet : public Widget
|
||||
*/
|
||||
QString pluginName() const;
|
||||
|
||||
/**
|
||||
* Whether the applet should conserve resources. If true, try to avoid doing stuff which
|
||||
* is computationally heavy. Try to conserve power and resources.
|
||||
*
|
||||
* @return true if it should conserve resources, false if it does not.
|
||||
*/
|
||||
Q_PROPERTY bool shouldConserveResources() const;
|
||||
|
||||
/**
|
||||
* Returns the icon related to this applet
|
||||
**/
|
||||
|
Loading…
Reference in New Issue
Block a user