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

Method setupActions

plugins/filemanager/filemanager.cpp:124–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void FileManager::setupActions()
125{
126 auto* acmBookmarks = new KActionMenu(QIcon::fromTheme(QStringLiteral("bookmarks")), i18nc("@title:menu", "Bookmarks"), this);
127 acmBookmarks->setPopupMode(QToolButton::InstantPopup);
128 m_bookmarkHandler = new BookmarkHandler(this, acmBookmarks->menu());
129 acmBookmarks->setShortcutContext(Qt::WidgetWithChildrenShortcut);
130
131 auto* action = new QAction(this);
132 action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
133 action->setText(i18nc("@action switch to directory of current document", "Current Document Directory"));
134 action->setIcon(QIcon::fromTheme(QStringLiteral("dirsync")));
135 connect(action, &QAction::triggered, this, &FileManager::syncCurrentDocumentDirectory);
136
137 tbActions = {
138 dirop->action(KDirOperator::Back),
139 dirop->action(KDirOperator::Up),
140 dirop->action(KDirOperator::Home),
141 dirop->action(KDirOperator::Forward),
142 dirop->action(KDirOperator::Reload),
143 acmBookmarks,
144 action,
145 dirop->action(KDirOperator::SortMenu),
146 dirop->action(KDirOperator::ShowHiddenFiles),
147 };
148
149 newFileAction = new QAction(this);
150 newFileAction->setText(i18nc("@action", "New File..."));
151 newFileAction->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
152 connect(newFileAction, &QAction::triggered, this, &FileManager::createNewFile);
153}
154
155void FileManager::createNewFile()
156{

Callers

nothing calls this directly

Calls 4

menuMethod · 0.80
setIconMethod · 0.80
setTextMethod · 0.45
actionMethod · 0.45

Tested by

no test coverage detected