no need to focus an applet twice

svn path=/trunk/KDE/kdelibs/; revision=905312
This commit is contained in:
Aaron J. Seigo 2009-01-04 07:59:10 +00:00
parent d282afc3ad
commit d4bb3c790a
2 changed files with 6 additions and 4 deletions

View File

@ -271,7 +271,7 @@ void Applet::restore(KConfigGroup &group)
void AppletPrivate::setFocus()
{
kDebug() << "setting focus";
//kDebug() << "setting focus";
q->setFocus(Qt::ShortcutFocusReason);
}

View File

@ -1373,15 +1373,17 @@ void ContainmentPrivate::focusApplet(Plasma::Applet *applet)
focusedApplet->removeAssociatedWidget(w);
}
}
//but what if applet isn't really one of our applets?
//FIXME should we really unfocus the old applet?
if (applet && applets.contains(applet)) {
//kDebug() << "switching to" << applet->name();
focusedApplet = applet;
foreach (QWidget *w, widgets) {
focusedApplet->addAssociatedWidget(w);
}
if (!focusedApplet->hasFocus()) {
focusedApplet->setFocus(Qt::ShortcutFocusReason);
}
} else {
focusedApplet = 0;
}