[dolphin] [Bug 430441] Dolphin 20.12.0 segmentation faults when trying to drag mounted partition in Places panel

Chris Holland bugzilla_noreply at kde.org
Fri Dec 18 00:01:10 GMT 2020


https://bugs.kde.org/show_bug.cgi?id=430441

--- Comment #5 from Chris Holland <zrenfire at gmail.com> ---
Was able to quickly reproduce in the release/20.12 branch.

    [KCrash Handler]
    #4  0x00007f40709b9e70 in QRect::width (this=0x10) at
/usr/include/qt/QtCore/qrect.h:266
    #5  0x00007f40709d642f in PlacesItemListWidget::paint (this=0x55e69f8e1a90,
painter=0x7fffe660e4c0, option=0x0, widget=0x55e69f73be10) at
/home/chris/Code/kde/dolphin/src/panels/places/placesitemlistwidget.cpp:118
    #6  0x00007f4070836883 in KItemListWidget::createDragPixmap
(this=0x55e69f8e1a90, option=0x0, widget=0x55e69f73be10) at
/home/chris/Code/kde/dolphin/src/kitemviews/kitemlistwidget.cpp:370
    #7  0x00007f4070840112 in KStandardItemListWidget::createDragPixmap
(this=0x55e69f8e1a90, option=0x0, widget=0x55e69f73be10) at
/home/chris/Code/kde/dolphin/src/kitemviews/kstandarditemlistwidget.cpp:550
    #8  0x00007f407081e5e7 in KItemListView::createDragPixmap
(this=0x55e69f82e230, indexes=...) at
/home/chris/Code/kde/dolphin/src/kitemviews/kitemlistview.cpp:628
    #9  0x00007f4070813763 in KItemListController::startDragging
(this=0x55e69f801750) at
/home/chris/Code/kde/dolphin/src/kitemviews/kitemlistcontroller.cpp:1264
    #10 0x00007f4070810b22 in KItemListController::mouseMoveEvent
(this=0x55e69f801750, event=0x7fffe660ebf0, transform=...) at
/home/chris/Code/kde/dolphin/src/kitemviews/kitemlistcontroller.cpp:598
    #11 0x00007f4070812ae7 in KItemListController::processEvent
(this=0x55e69f801750, event=0x7fffe660ebf0, transform=...) at
/home/chris/Code/kde/dolphin/src/kitemviews/kitemlistcontroller.cpp:1104

Weird, option=0x0. So QStyleOptionGraphicsItem* option is null. So it's
breaking when I try to calculate the size of the capacitybar.

    QRect capacityRect(
        textInfo->pos.x(),
        option->rect.top() + option->rect.height() - CAPACITYBAR_HEIGHT -
CAPACITYBAR_MARGIN,
        qMin((qreal)option->rect.width(), selectionRect().width()) -
(textInfo->pos.x() - option->rect.left()),
        CAPACITYBAR_HEIGHT
    );

I wasn't aware that it could be null:
https://doc.qt.io/archives/qt-4.8/qgraphicswidget.html#paint
https://doc.qt.io/archives/qt-4.8/qgraphicsitem.html#paint

I can easily check if option is null with `if (m_drawCapacityBar && option)`,
it won't draw the capacitybar in the drag though.

    // We check if option=nullptr since it is null when the place is dragged.
    // https://bugs.kde.org/show_bug.cgi?id=430441
    if (m_drawCapacityBar && option) {

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kfm-devel mailing list