locked property in applet too

svn path=/trunk/KDE/kdebase/workspace/; revision=1120691
This commit is contained in:
Marco Martin 2010-04-29 17:39:24 +00:00
parent 0d235ed8af
commit d0d9f2f772
2 changed files with 24 additions and 0 deletions

View File

@ -210,6 +210,26 @@ QString Applet::version() const
return info.version();
}
void Applet::setLocked(bool locked)
{
Plasma::Applet *app = applet();
if (!app) {
return;
}
app->setImmutability(locked ? Plasma::UserImmutable : Plasma::Mutable);
}
bool Applet::locked() const
{
Plasma::Applet *app = applet();
if (!app) {
return Plasma::Mutable;
}
return app->immutability() != Plasma::Mutable;
}
Plasma::Applet *Applet::applet() const
{
return 0;

View File

@ -35,6 +35,7 @@ namespace Plasma
class PLASMAGENERICSHELL_EXPORT Applet : public QObject
{
Q_OBJECT
Q_PROPERTY(bool locked READ locked WRITE setLocked)
public:
Applet(QObject *parent = 0);
@ -54,6 +55,9 @@ public:
QString version() const;
void setLocked(bool locked);
bool locked() const;
virtual Plasma::Applet *applet() const;
public Q_SLOTS: