Fixing the force-creation of applets when plasma is immutable
REVIEW:127442
This commit is contained in:
parent
92e2c07adf
commit
8bd9e56572
@ -92,6 +92,10 @@ Applet::Applet(QObject *parentObject, const QVariantList &args)
|
|||||||
d->appletDescription = KPluginInfo(args);
|
d->appletDescription = KPluginInfo(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.contains("org.kde.plasma:force-create")) {
|
||||||
|
setProperty("org.kde.plasma:force-create", true);
|
||||||
|
}
|
||||||
|
|
||||||
// WARNING: do not access config() OR globalConfig() in this method!
|
// WARNING: do not access config() OR globalConfig() in this method!
|
||||||
// that requires a scene, which is not available at this point
|
// that requires a scene, which is not available at this point
|
||||||
d->init(QString(), args.mid(2));
|
d->init(QString(), args.mid(2));
|
||||||
|
@ -372,10 +372,6 @@ Applet *Containment::createApplet(const QString &name, const QVariantList &args)
|
|||||||
|
|
||||||
void Containment::addApplet(Applet *applet)
|
void Containment::addApplet(Applet *applet)
|
||||||
{
|
{
|
||||||
if (immutability() != Types::Mutable) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!applet) {
|
if (!applet) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// qCDebug(LOG_PLASMA) << "adding null applet!?!";
|
// qCDebug(LOG_PLASMA) << "adding null applet!?!";
|
||||||
@ -383,6 +379,10 @@ void Containment::addApplet(Applet *applet)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (immutability() != Types::Mutable && !applet->property("org.kde.plasma:force-create").toBool()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (d->applets.contains(applet)) {
|
if (d->applets.contains(applet)) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// qCDebug(LOG_PLASMA) << "already have this applet!";
|
// qCDebug(LOG_PLASMA) << "already have this applet!";
|
||||||
|
Loading…
Reference in New Issue
Block a user