Commit 078f357b authored by Stefano Crocco's avatar Stefano Crocco
Browse files

Fix crash due to changes in KBookmarkMenu

Since version 5.69, KBookmarkMenu doesn't automatically create an action
collection. This causes Konqueror to crash when going on a submenu in
the Bookmarks menu. To avoid it, manually create the action collection.

Also, avoid calling the version of KBookmarkMenu construction which
takes a KActionCollection, as it's deprecated.

Test Plan:
Open the bookmarks menu and hover with the mouse on a submenu. Check
that it crashes. Do the same after this change and check it doesn't crash

Reviewers: dfaure, nicolasfella

Reviewed By: nicolasfella

Subscribers: poboiko

Differential Revision:
parent 3a07793f
......@@ -25,6 +25,8 @@
#include "kbookmarkactionmenu.h"
#include "kbookmarkcontextmenu.h"
#include <KActionCollection>
namespace Konqueror { // to avoid clashing with KF5::Bookmarks which had a KonqBookmarkMenu class. Remove once using KF6.
class KonqBookmarkMenu : public KBookmarkMenu
......@@ -45,8 +47,9 @@ public:
* @param collec parent collection for the KActions.
KonqBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, KBookmarkActionMenu *parentMenu, KActionCollection *collec)
: KBookmarkMenu(mgr, owner, parentMenu->menu(), collec)
: KBookmarkMenu(mgr, owner, parentMenu->menu())
m_actionCollection = collec;
~KonqBookmarkMenu() override
......@@ -58,6 +61,7 @@ public:
KonqBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, KBookmarkActionMenu *parentMenu, QString parentAddress)
: KBookmarkMenu(mgr, owner, parentMenu->menu(), parentAddress)
m_actionCollection = new KActionCollection(this);
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