File indexing completed on 2024-04-21 09:42:20

0001 /*  This file was part of the KDE libraries
0002 
0003     SPDX-FileCopyrightText: 2019 Tomaz Canabrava <tcanabrava@kde.org>
0004     SPDX-FileCopyrightText: 2019 Martin Sandsmark <martin.sandsmark@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef BOOKMARKMENU_H
0010 #define BOOKMARKMENU_H
0011 
0012 // KDE
0013 #include <KBookmarkMenu>
0014 
0015 // Konsole
0016 #include "konsoleprivate_export.h"
0017 
0018 class KActionCollection;
0019 
0020 /* Hackish hack to mitigate a broken behavior of KBookmarkMenu.
0021  * slotAddBookmark accepts duplicates and it's fragile code,
0022  * that thing really deserves a rewrite.
0023  * the easiest way is to "hijack" it's protected method to public
0024  * and just cast around.
0025  */
0026 class KONSOLEPRIVATE_EXPORT BookmarkMenu : public KBookmarkMenu
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031     BookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collection);
0032 
0033 private Q_SLOTS:
0034     void maybeAddBookmark();
0035 };
0036 
0037 #endif // BOOKMARKMENU_H