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

Method customContextMenuRequested

plugins/patchreview/patchreviewtoolview.cpp:263–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void PatchReviewToolView::customContextMenuRequested(const QPoint& pos)
264{
265 QList<QUrl> urls;
266 const QModelIndexList selectionIdxs = m_editPatch.filesList->selectionModel()->selectedIndexes();
267 urls.reserve(selectionIdxs.size());
268 for (const QModelIndex& idx : selectionIdxs) {
269 urls += idx.data(KDevelop::VcsFileChangesModel::UrlRole).toUrl();
270 }
271
272 QPointer<QMenu> menu = new QMenu(m_editPatch.filesList);
273 QList<ContextMenuExtension> extensions;
274 if(!urls.isEmpty()) {
275 KDevelop::FileContext context(urls);
276 extensions = ICore::self()->pluginController()->queryPluginsForContextMenuExtensions(&context, menu);
277 }
278
279 QList<QAction*> vcsActions;
280 for (const ContextMenuExtension& ext : std::as_const(extensions)) {
281 vcsActions += ext.actions(ContextMenuExtension::VcsGroup);
282 }
283
284 menu->addAction(m_selectAllAction);
285 menu->addAction(m_deselectAllAction);
286 menu->addActions(vcsActions);
287 menu->exec(m_editPatch.filesList->viewport()->mapToGlobal(pos));
288
289 delete menu;
290}
291
292void PatchReviewToolView::nextHunk()
293{

Callers

nothing calls this directly

Calls 10

pluginControllerMethod · 0.80
execMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
toUrlMethod · 0.45
dataMethod · 0.45
isEmptyMethod · 0.45
actionsMethod · 0.45
addActionMethod · 0.45

Tested by

no test coverage detected