From 588abbf1b6994245d987c0d07c2b074cb76fc034 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 3 Jun 2018 13:08:51 +0200 Subject: Fix crash in PlacesItem::setUrl() Connections to lambda slots without context/receiver argument can lead to crashes, because if the receiver is deleted Qt won't delete the connection as it normally would when the receiver is specified. This patch moves the slot from the lambda in PlacesItem (which is not a QObject) to PlacesItemSignalHandler. This fixes the `dolphinmainwindowtest` crash we currently have on master, and should also fix bug #394507 which has the very same stacktrace. BUG: 394507 FIXED-IN: 18.04.2 --- src/panels/places/placesitemsignalhandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/panels/places/placesitemsignalhandler.cpp') diff --git a/src/panels/places/placesitemsignalhandler.cpp b/src/panels/places/placesitemsignalhandler.cpp index c85c8336e..b313f838f 100644 --- a/src/panels/places/placesitemsignalhandler.cpp +++ b/src/panels/places/placesitemsignalhandler.cpp @@ -51,3 +51,10 @@ void PlacesItemSignalHandler::onTearDownRequested(const QString& udi) } } +void PlacesItemSignalHandler::onTrashEmptinessChanged(bool isTrashEmpty) +{ + if (m_item) { + m_item->setIcon(isTrashEmpty ? QStringLiteral("user-trash") : QStringLiteral("user-trash-full")); + } +} + -- cgit v1.3