watchForFocus() dies

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801641
This commit is contained in:
Davide Bettio 2008-04-27 09:53:49 +00:00
parent 624f8d0fb3
commit 41d2aa43e4
2 changed files with 0 additions and 39 deletions

View File

@ -323,7 +323,6 @@ public:
KPluginInfo appletDescription;
Package* package;
OverlayWidget *needsConfigOverlay;
QList<QObject*> watchedForFocus;
QList<QGraphicsItem*> watchedForMouseMove;
QStringList loadedEngines;
Plasma::PanelSvg *background;
@ -1158,24 +1157,6 @@ QString Applet::instanceName() const
return d->instanceName();
}
void Applet::watchForFocus(QObject *widget, bool watch)
{
if (!widget) {
return;
}
int index = d->watchedForFocus.indexOf(widget);
if (watch) {
if (index == -1) {
d->watchedForFocus.append(widget);
widget->installEventFilter(this);
}
} else if (index != -1) {
d->watchedForFocus.removeAt(index);
widget->removeEventFilter(this);
}
}
void Applet::watchForMouseMove( QGraphicsItem * watched, bool watch )
{
if (!watched) {
@ -1206,16 +1187,6 @@ void Applet::setHasConfigurationInterface(bool hasInterface)
bool Applet::eventFilter( QObject *o, QEvent * e )
{
if ( !d->watchedForFocus.contains( o ) )
{
if ( e->type() == QEvent::MouseButtonRelease ||
e->type() == QEvent::FocusIn ) {
//needsFocus( true ); <-- died
} else if ( e->type() == QEvent::FocusOut ) {
//needsFocus( false ); <-- died
}
}
return QObject::eventFilter(o, e);
}

View File

@ -653,16 +653,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
*/
void setBackgroundHints(const BackgroundHints hints);
/**
* Register widgets that can receive keyboard focus.
*
* Calling this results in an eventFilter being placed on the widget.
*
* @param widget the widget to watch for keyboard focus
* @param watch whether to start watching the widget, or to stop doing so
*/
void watchForFocus(QObject *widget, bool watch = true);
/**
* Register the widgets that manages mouse clicks but you still want
* to be able to drag the applet around when holding the mouse pointer