plasma: do not deep-copy the Plasma::Applet::action() and Plasma::Applet::addAction() arguments

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-09-14 12:00:06 +03:00
parent 7d56c26074
commit e66a124829
2 changed files with 4 additions and 4 deletions

View file

@ -1363,12 +1363,12 @@ QList<QAction*> Applet::contextualActions()
return d->script ? d->script->contextualActions() : QList<QAction*>(); return d->script ? d->script->contextualActions() : QList<QAction*>();
} }
QAction *Applet::action(QString name) const QAction *Applet::action(const QString &name) const
{ {
return d->actions->action(name); return d->actions->action(name);
} }
void Applet::addAction(QString name, QAction *action) void Applet::addAction(const QString &name, QAction *action)
{ {
d->actions->addAction(name, action); d->actions->addAction(name, action);
} }

View file

@ -482,12 +482,12 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
/** /**
* Returns the QAction with the given name from our collection * Returns the QAction with the given name from our collection
*/ */
Q_INVOKABLE QAction *action(QString name) const; Q_INVOKABLE QAction *action(const QString &name) const;
/** /**
* Adds the action to our collection under the given name * Adds the action to our collection under the given name
*/ */
void addAction(QString name, QAction *action); void addAction(const QString &name, QAction *action);
/** /**
* Sets the BackgroundHints for this applet @see BackgroundHint * Sets the BackgroundHints for this applet @see BackgroundHint