MCPcopy Create free account
hub / github.com/KDE/kdevelop / BookmarkHandler

Method BookmarkHandler

plugins/filemanager/bookmarkhandler.cpp:19–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include <QMenu>
18
19BookmarkHandler::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
44BookmarkHandler::~BookmarkHandler()
45{

Callers

nothing calls this directly

Calls 3

dataDirectoryMethod · 0.80
activeSessionMethod · 0.45
actionsMethod · 0.45

Tested by

no test coverage detected