Commit d6e3f653 authored by Stefano Crocco's avatar Stefano Crocco Committed by David Faure

Fix crash due to changes in KBookmarkMenu

Summary:
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
anymore.

Reviewers: dfaure, nicolasfella

Reviewed By: dfaure, nicolasfella

Subscribers: arojas, poboiko

Differential Revision: https://phabricator.kde.org/D28789

(cherry picked from commit b61086cf)
parent 8f77a632
......@@ -26,6 +26,7 @@
#include "kbookmarkcontextmenu.h"
#include <KActionCollection>
#include <kbookmarks_version.h>
namespace Konqueror { // to avoid clashing with KF5::Bookmarks which had a KonqBookmarkMenu class. Remove once using KF6.
......@@ -61,7 +62,10 @@ public:
KonqBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, KBookmarkActionMenu *parentMenu, QString parentAddress)
: KBookmarkMenu(mgr, owner, parentMenu->menu(), parentAddress)
{
//KBookmarkMenu doesn't create an action collection only in version 5.69.0
#if KBOOKMARKS_VERSION == QT_VERSION_CHECK(5, 69, 0)
m_actionCollection = new KActionCollection(this);
#endif
}
protected:
......
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