replace name, pluginName and icon with pluginInfo()

add ContainmentAction::pluginInfo()
This commit is contained in:
Marco Martin 2013-02-25 14:49:42 +01:00
parent f00987658b
commit c3a536a7a4
3 changed files with 10 additions and 43 deletions

View File

@ -551,7 +551,7 @@ void Containment::addContainmentActions(const QString &trigger, const QString &p
if (containmentActions().contains(trigger)) { if (containmentActions().contains(trigger)) {
plugin = containmentActions().value(trigger); plugin = containmentActions().value(trigger);
if (plugin->pluginName() != pluginName) { if (plugin->pluginInfo().pluginName() != pluginName) {
containmentActions().remove(trigger); containmentActions().remove(trigger);
delete plugin; delete plugin;
plugin = 0; plugin = 0;

View File

@ -66,6 +66,11 @@ ContainmentActions::~ContainmentActions()
delete d; delete d;
} }
KPluginInfo ContainmentActions::pluginInfo() const
{
return d->containmentActionsDescription;
}
Containment *ContainmentActions::containment() Containment *ContainmentActions::containment()
{ {
if (d->containment) { if (d->containment) {
@ -74,33 +79,6 @@ Containment *ContainmentActions::containment()
return qobject_cast<Containment*>(parent()); return qobject_cast<Containment*>(parent());
} }
QString ContainmentActions::name() const
{
if (!d->containmentActionsDescription.isValid()) {
return i18n("Unknown ContainmentActions");
}
return d->containmentActionsDescription.name();
}
QString ContainmentActions::icon() const
{
if (!d->containmentActionsDescription.isValid()) {
return QString();
}
return d->containmentActionsDescription.icon();
}
QString ContainmentActions::pluginName() const
{
if (!d->containmentActionsDescription.isValid()) {
return QString();
}
return d->containmentActionsDescription.pluginName();
}
void ContainmentActions::setSource(ContainmentActionsSource source) void ContainmentActions::setSource(ContainmentActionsSource source)
{ {
d->containmentActionsSource = source; d->containmentActionsSource = source;

View File

@ -76,22 +76,11 @@ class PLASMA_EXPORT ContainmentActions : public QObject
~ContainmentActions(); ~ContainmentActions();
/** /**
* Returns the user-visible name for the containmentactions, as specified in the * @return the plugin info for this ContainmentActions instance,
* .desktop file. * including name, pluginName and icon
* * @since 5.0
* @return the user-visible name for the containmentactions.
**/
QString name() const;
/**
* Returns the plugin name for the containmentactions
*/ */
QString pluginName() const; KPluginInfo pluginInfo() const;
/**
* Returns the icon related to this containmentactions
**/
QString icon() const;
/** /**
* Returns the configurations of this containmentactions * Returns the configurations of this containmentactions