| 17 | #include <QMenu> |
| 18 | |
| 19 | BookmarkHandler::BookmarkHandler( FileManager *parent, QMenu* kpopupmenu ) |
| 20 | : QObject( parent ), |
| 21 | KBookmarkOwner(), |
| 22 | m_parent( parent ), |
| 23 | m_menu( kpopupmenu ) |
| 24 | { |
| 25 | setObjectName( QStringLiteral( "BookmarkHandler" ) ); |
| 26 | |
| 27 | // The subpath had been pluginId/"fsbookmarks.xml" with pluginId="kdevfilemanager" before |
| 28 | // 715d09e5545758af0ba85c8fea7c11ecb94eb9ad accidentally removed the slash after pluginId while |
| 29 | // porting from KUrl to QUrl. So now we are stuck with the long filename for backward compatibility. |
| 30 | const QString bookmarksPath = |
| 31 | KDevelop::ICore::self()->activeSession()->dataDirectory() + QLatin1String("/kdevfilemanagerfsbookmarks.xml"); |
| 32 | qCDebug(PLUGIN_FILEMANAGER) << bookmarksPath; |
| 33 | |
| 34 | auto* const manager = new KBookmarkManager(bookmarksPath, this); |
| 35 | m_bookmarkMenu = new KBookmarkMenu(manager, this, m_menu); |
| 36 | const auto actions = m_menu->actions(); |
| 37 | |
| 38 | //remove shortcuts as they might conflict with others (eg. Ctrl+B) |
| 39 | for (QAction* action : actions) { |
| 40 | action->setShortcut(QKeySequence()); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | BookmarkHandler::~BookmarkHandler() |
| 45 | { |
nothing calls this directly
no test coverage detected