introduce appletCreated signal
appletCreated is different from appletAdded because it gets emitted only when the user explicitly creates one, so not in case of an applet migrating and not during restore needed by https://git.reviewboard.kde.org/r/125562/ REVIEW:125569 Change-Id: I1db9286beb160391c13f1aca0ac48ed490495ea2
This commit is contained in:
parent
7cafe26fa0
commit
84fc7672f6
@ -362,7 +362,9 @@ void Containment::setLocation(Types::Location location)
|
||||
|
||||
Applet *Containment::createApplet(const QString &name, const QVariantList &args)
|
||||
{
|
||||
return d->createApplet(name, args);
|
||||
Plasma::Applet *applet = d->createApplet(name, args);
|
||||
emit appletCreated(applet);
|
||||
return applet;
|
||||
}
|
||||
|
||||
void Containment::addApplet(Applet *applet)
|
||||
|
@ -199,7 +199,11 @@ public:
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
* This signal is emitted when a new applet is created by the containment
|
||||
* This signal is emitted when a new applet is added in the containment
|
||||
* It may happen in the following situations:
|
||||
* * The user created the applet
|
||||
* * The applet was moved in from another containment
|
||||
* * The applet got restored at startup
|
||||
*/
|
||||
void appletAdded(Plasma::Applet *applet);
|
||||
|
||||
@ -208,6 +212,16 @@ Q_SIGNALS:
|
||||
*/
|
||||
void appletRemoved(Plasma::Applet *applet);
|
||||
|
||||
/**
|
||||
* This signal is emitted when a new applet is created by the containment.
|
||||
* Compared to appletAdded, this gets emitted only when the user explicitly
|
||||
* creates a new applet, either via the widget explorer or the scripting
|
||||
* environment.
|
||||
* @see appletAdded
|
||||
* @since 5.16
|
||||
*/
|
||||
void appletCreated(Plasma::Applet *applet);
|
||||
|
||||
/**
|
||||
* Emitted when the activity id has changed
|
||||
*/
|
||||
|
@ -514,6 +514,10 @@ Containment *CoronaPrivate::addContainment(const QString &name, const QVariantLi
|
||||
q->requestConfigSync();
|
||||
containment->flushPendingConstraintsEvents();
|
||||
emit q->containmentAdded(containment);
|
||||
//if id = 0 a new containment has been created, not restored
|
||||
if (id == 0) {
|
||||
emit q->containmentCreated(containment);
|
||||
}
|
||||
}
|
||||
|
||||
return containment;
|
||||
|
@ -264,10 +264,20 @@ public Q_SLOTS:
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
* This signal indicates a new containment has been added to
|
||||
* the Corona
|
||||
* the Corona: it may occur after creation or restore from config
|
||||
*/
|
||||
void containmentAdded(Plasma::Containment *containment);
|
||||
|
||||
/**
|
||||
* This signal indicates a new containment has been created
|
||||
* in the Corona. Compared to containmentAdded it can only happen
|
||||
* after the creation of a new containment.
|
||||
*
|
||||
* @see containmentAdded
|
||||
* @since 5.16
|
||||
*/
|
||||
void containmentCreated(Plasma::Containment *containment);
|
||||
|
||||
/**
|
||||
* This signal indicates that a containment has been newly
|
||||
* associated (or dissociated) with a physical screen.
|
||||
|
@ -62,11 +62,12 @@ xml ed --subnode "/svg:svg/svg:defs" -t elem -n "style" -v "$stylesheet"\
|
||||
for i in {0..4}
|
||||
do
|
||||
xml ed --subnode "//*/*[contains(@style, '${colors[i]}')]" -t attr -n "class" -v "${colorNames[i]}" temp.svg > temp2.svg
|
||||
|
||||
mv temp2.svg temp.svg
|
||||
|
||||
echo sed -i 's/\(style=".*\)fill:'${colors[i]}'/\1fill:currentColor/g' temp.svg
|
||||
sed -i 's/\(style=".*\)fill:'${colors[i]}'/\1fill:currentColor/g' temp.svg
|
||||
done
|
||||
|
||||
mv temp.svg $file.svgz
|
||||
mv temp.svg $file.svg
|
||||
gzip $file.svg
|
||||
mv $file.svg.gz $file.svgz
|
||||
|
Loading…
Reference in New Issue
Block a user