locked property in applet too
svn path=/trunk/KDE/kdebase/workspace/; revision=1120691
This commit is contained in:
parent
0d235ed8af
commit
d0d9f2f772
20
applet.cpp
20
applet.cpp
@ -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;
|
||||
|
4
applet.h
4
applet.h
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user