expose the KActionCollection rather than wrap its API

This commit is contained in:
Aaron Seigo 2013-02-25 16:36:27 +01:00
parent c9ff91fb0f
commit a674a7b894
4 changed files with 6 additions and 40 deletions

View File

@ -130,7 +130,7 @@ void Containment::init()
}
if (immutability() != SystemImmutable && corona()) {
QAction *lockDesktopAction = corona()->action("lock widgets");
QAction *lockDesktopAction = corona()->actions()->action("lock widgets");
//keep a pointer so nobody notices it moved to corona
if (lockDesktopAction) {
actions()->addAction("lock widgets", lockDesktopAction);

View File

@ -356,24 +356,9 @@ QList<Plasma::Location> Corona::freeEdges(int screen) const
return freeEdges;
}
QAction *Corona::action(QString name) const
KActionCollection *Corona::actions() const
{
return d->actions.action(name);
}
void Corona::addAction(QString name, QAction *action)
{
d->actions.addAction(name, action);
}
KAction* Corona::addAction(QString name)
{
return d->actions.addAction(name);
}
QList<QAction*> Corona::actions() const
{
return d->actions.actions();
return &d->actions;
}
void Corona::enableAction(const QString &name, bool enable)

View File

@ -164,21 +164,6 @@ public:
*/
QList<Plasma::Location> freeEdges(int screen) const;
/**
* Returns the QAction with the given name from our collection
*/
QAction *action(QString name) const;
/**
* Adds the action to our collection under the given name
*/
void addAction(QString name, QAction *action);
/**
* Returns all the actions in our collection
*/
QList<QAction*> actions() const;
/**
* convenience function - enables or disables an action by name
*
@ -204,13 +189,9 @@ public:
void addShortcuts(KActionCollection *newShortcuts);
/**
* @since 4.3
* Creates an action in our collection under the given name
* @return the new action
* FIXME I'm wrapping so much of kactioncollection API now, maybe I should just expose the
* collection itself :P
* The actions assocated with this Corona
*/
KAction* addAction(QString name);
KActionCollection* actions() const;
/**
* @since 5.0

View File

@ -63,8 +63,8 @@ AppletPrivate::AppletPrivate(KService::Ptr service, const KPluginInfo *info, int
itemStatus(UnknownStatus),
modificationsTimer(0),
hasConfigurationInterface(false),
failed(false),
isContainment(false),
failed(false),
transient(false),
needsConfig(false),
started(false)