remove Corona::defaultContainmentActionsPlugins()

This commit is contained in:
Marco Martin 2013-03-13 11:29:42 +01:00
parent 7abd6d81d5
commit 4219697fcb
4 changed files with 13 additions and 23 deletions

View File

@ -191,7 +191,7 @@ void Containment::restore(KConfigGroup &group)
KConfigGroup cfg = KConfigGroup(corona()->config(), "ActionPlugins");
cfg = KConfigGroup(&cfg, QString::number(containmentType()));
//kDebug() << cfg.keyList();
if (cfg.exists()) {
@ -200,11 +200,18 @@ void Containment::restore(KConfigGroup &group)
addContainmentActions(key, cfg.readEntry(key, QString()));
}
} else { //shell defaults
//steal the data directly, for efficiency
QHash<QString,QString> defaults = corona()->defaultContainmentActionsPlugins(d->type);
for (QHash<QString,QString>::const_iterator it = defaults.constBegin(),
end = defaults.constEnd(); it != end; ++it) {
addContainmentActions(it.key(), it.value());
KConfigGroup defaultActionsCfg;
if (d->type == Plasma::PanelContainment) {
defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->package().filePath("defaults")), "Panel");
//Plasma::DesktopContainment
} else {
defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->package().filePath("defaults")), "Desktop");
}
defaultActionsCfg = KConfigGroup(&defaultActionsCfg, "ContainmentActions");
foreach (const QString &key, defaultActionsCfg.keyList()) {
//kDebug() << "loading" << key;
addContainmentActions(key, cfg.readEntry(key, QString()));
}
}

View File

@ -278,12 +278,6 @@ KActionCollection *Corona::actions() const
return &d->actions;
}
QHash<QString, QString> Corona::defaultContainmentActionsPlugins(ContainmentType containmentType) const
{
//FIXME: need to read these out of the package
return d->containmentActionsDefaults.value(containmentType);
}
CoronaPrivate::CoronaPrivate(Corona *corona)
: q(corona),
immutability(Mutable),

View File

@ -34,7 +34,6 @@ namespace Plasma
{
class CoronaPrivate;
class ContainmentActionsPluginsConfig;
/**
* @class Corona plasma/Corona.h <Plasma/Corona>
@ -135,15 +134,6 @@ public:
*/
KActionCollection* actions() const;
/**
* @since 5.0
* Returns the default containmentactions plugins for the given containment type.
*
* @arg containmentType the type of containment these actions apply to
* @return a hash containing the triggers and the plugin names associated with them
*/
QHash<QString, QString> defaultContainmentActionsPlugins(ContainmentType containmentType) const;
/**
* Imports an applet layout from a config file. The results will be added to the
* current set of Containments.

View File

@ -58,7 +58,6 @@ public:
QTimer *configSyncTimer;
QList<Containment*> containments;
KActionCollection actions;
QMap<Plasma::ContainmentType, QHash<QString, QString> > containmentActionsDefaults;
};
}