only care about mucking about with the focus item if it isn't null

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=863641
This commit is contained in:
Aaron J. Seigo 2008-09-22 18:35:24 +00:00
parent a680170b8f
commit a90457d7a1

View File

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