started on docu fixes from ebn until i realized that the line numbers are all messed up in the apidox tests and so moved on
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=690174
This commit is contained in:
parent
af043ca588
commit
51a0162fae
25
applet.cpp
25
applet.cpp
@ -95,6 +95,17 @@ public:
|
||||
delete package;
|
||||
}
|
||||
|
||||
void init(Applet* applet)
|
||||
{
|
||||
if (!appletDescription) {
|
||||
applet->setFailedToLaunch(true);
|
||||
}
|
||||
|
||||
applet->setImmutable(applet->globalConfig().isImmutable() ||
|
||||
applet->config().isImmutable());
|
||||
|
||||
}
|
||||
|
||||
static uint nextId()
|
||||
{
|
||||
++s_maxAppletId;
|
||||
@ -127,7 +138,7 @@ Applet::Applet(QGraphicsItem *parent,
|
||||
Widget(parent),
|
||||
d(new Private(KService::serviceByStorageId(serviceID), appletId))
|
||||
{
|
||||
init();
|
||||
d->init(this);
|
||||
}
|
||||
|
||||
Applet::Applet(QObject* parent, const QStringList& args)
|
||||
@ -136,7 +147,7 @@ Applet::Applet(QObject* parent, const QStringList& args)
|
||||
d(new Private(KService::serviceByStorageId(args.count() > 0 ? args[0] : QString()),
|
||||
args.count() > 1 ? args[1].toInt() : 0))
|
||||
{
|
||||
init();
|
||||
d->init(this);
|
||||
// the brain damage seen in the initialization list is due to the
|
||||
// inflexibility of KService::createInstance
|
||||
}
|
||||
@ -147,16 +158,6 @@ Applet::~Applet()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void Applet::init()
|
||||
{
|
||||
if (!d->appletDescription) {
|
||||
setFailedToLaunch(true);
|
||||
}
|
||||
|
||||
setImmutable(globalConfig().isImmutable() ||
|
||||
config().isImmutable());
|
||||
}
|
||||
|
||||
KConfigGroup Applet::config() const
|
||||
{
|
||||
if (!d->appletConfig) {
|
||||
|
15
applet.h
15
applet.h
@ -324,9 +324,16 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
|
||||
**/
|
||||
void setFailedToLaunch(bool failed, const QString& reason = QString());
|
||||
|
||||
// Reimplemented from QGraphicsItem
|
||||
enum { Type = Plasma::AppletType };
|
||||
|
||||
/**
|
||||
* Reimplemented from QGraphicsItem
|
||||
**/
|
||||
int type() const { return Type; }
|
||||
|
||||
/**
|
||||
* Reimplemented from QGraphicsItem
|
||||
**/
|
||||
QRectF boundingRect () const;
|
||||
|
||||
Q_SIGNALS:
|
||||
@ -401,11 +408,11 @@ class PLASMA_EXPORT Applet : public QObject, public Widget
|
||||
private:
|
||||
Q_DISABLE_COPY(Applet)
|
||||
|
||||
// Reimplemented from QGraphicsItem
|
||||
/**
|
||||
* Reimplemented from QGraphicsItem
|
||||
**/
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
||||
|
||||
void init();
|
||||
|
||||
class Private;
|
||||
Private* const d;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user