Commit a8a2c080 authored by David Faure's avatar David Faure

KFileWidget: fix crash on FreeBSD (from the destructor)

KFileWidget::eventFilter()
(QEvent::Destroy event)
QWidget::~QWidget()
KDirOperator::~KDirOperator
KFileWidgetPrivate::~KFileWidgetPrivate
KFileWidget::~KFileWidget

In that event filter, the d pointer is in the process of being deleted,
better not use it. The event filter is only about key events anyway,
skip it for everything else.
parent d0df7a02
......@@ -1849,7 +1849,8 @@ bool KFileWidget::eventFilter(QObject *watched, QEvent *event)
const bool res = QWidget::eventFilter(watched, event);
QKeyEvent *keyEvent = dynamic_cast<QKeyEvent *>(event);
if (watched == d->m_iconSizeSlider && keyEvent) {
if (keyEvent) {
if (watched == d->m_iconSizeSlider) {
if (keyEvent->key() == Qt::Key_Left || keyEvent->key() == Qt::Key_Up ||
keyEvent->key() == Qt::Key_Right || keyEvent->key() == Qt::Key_Down) {
d->slotIconSizeSliderMoved(d->m_iconSizeSlider->value());
......@@ -1877,6 +1878,7 @@ bool KFileWidget::eventFilter(QObject *watched, QEvent *event)
event->accept();
return true;
}
}
return res;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment