mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +00:00
Revert commit 0c6c76b038e868e225f7816fae39635d472bce0a and make the
QWeakPointer a QPointer (+comment) to make it clear, that we must track the lifetime of the context menu instead of doing "only" out of scope deleting. Thanks to Frank for pointing out this problem! CCMAIL: frank78ac@googlemail.com
This commit is contained in:
parent
a06ee3399b
commit
f8187b982a
|
@ -758,7 +758,7 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
|
|||
const QUrl& url,
|
||||
const QList<QAction*>& customActions)
|
||||
{
|
||||
QScopedPointer<DolphinContextMenu> contextMenu(new DolphinContextMenu(this, pos, item, url));
|
||||
QPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, pos, item, url);
|
||||
contextMenu.data()->setCustomActions(customActions);
|
||||
const DolphinContextMenu::Command command = contextMenu.data()->open();
|
||||
|
||||
|
@ -781,6 +781,11 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Delete the menu, unless it has been deleted in its own nested event loop already.
|
||||
if (contextMenu) {
|
||||
contextMenu->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinMainWindow::updateControlMenu()
|
||||
|
|
Loading…
Reference in a new issue