don't create the toolbox unnecessarily

there's really no point trying to mess with specific tools when the toolbox itself isn't there.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=786440
This commit is contained in:
Chani Armitage 2008-03-16 23:58:12 +00:00
parent 863e0f7797
commit 1f6956398d

View File

@ -1246,12 +1246,17 @@ Plasma::Widget * Containment::addToolBoxTool(const QString& toolName, const QStr
void Containment::enableToolBoxTool(const QString &toolname, bool enable) void Containment::enableToolBoxTool(const QString &toolname, bool enable)
{ {
d->createToolbox()->enableTool(toolname, enable); if (d->toolbox) {
d->toolbox->enableTool(toolname, enable);
}
} }
bool Containment::isToolboxToolEnabled(const QString &toolname) const bool Containment::isToolboxToolEnabled(const QString &toolname) const
{ {
return d->createToolbox()->isToolEnabled(toolname); if (d->toolbox) {
return d->toolbox->isToolEnabled(toolname);
}
return false;
} }
void Containment::showToolbox() void Containment::showToolbox()