add clearApplets() method to Corona, as discussed on panel-devel.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=698001
This commit is contained in:
parent
b4a001e6e1
commit
c89bd8f0bf
11
corona.cpp
11
corona.cpp
@ -191,9 +191,8 @@ void Corona::saveApplets() const
|
|||||||
|
|
||||||
void Corona::loadApplets(const QString& config)
|
void Corona::loadApplets(const QString& config)
|
||||||
{
|
{
|
||||||
qDeleteAll(d->applets);
|
clearApplets();
|
||||||
d->applets.clear();
|
|
||||||
|
|
||||||
KConfig appletConfig(config, KConfig::OnlyLocal);
|
KConfig appletConfig(config, KConfig::OnlyLocal);
|
||||||
foreach (const QString& group, appletConfig.groupList()) {
|
foreach (const QString& group, appletConfig.groupList()) {
|
||||||
KConfigGroup cg(&appletConfig, group);
|
KConfigGroup cg(&appletConfig, group);
|
||||||
@ -207,6 +206,12 @@ void Corona::loadApplets()
|
|||||||
loadApplets("plasma-appletsrc");
|
loadApplets("plasma-appletsrc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Corona::clearApplets()
|
||||||
|
{
|
||||||
|
qDeleteAll(d->applets);
|
||||||
|
d->applets.clear();
|
||||||
|
}
|
||||||
|
|
||||||
Applet* Corona::addApplet(const QString& name, const QStringList& args, uint id, const QRectF& geometry)
|
Applet* Corona::addApplet(const QString& name, const QStringList& args, uint id, const QRectF& geometry)
|
||||||
{
|
{
|
||||||
Applet* applet = Applet::loadApplet(name, id, args);
|
Applet* applet = Applet::loadApplet(name, id, args);
|
||||||
|
5
corona.h
5
corona.h
@ -90,6 +90,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
void loadApplets(const QString &config);
|
void loadApplets(const QString &config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the Corona from all applets.
|
||||||
|
*/
|
||||||
|
void clearApplets();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
/**
|
/**
|
||||||
* Load applets from the default config file
|
* Load applets from the default config file
|
||||||
|
Loading…
Reference in New Issue
Block a user