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

Method createMenu

kdevplatform/vcs/vcspluginhelper.cpp:118–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 }
117
118 QMenu* createMenu(QWidget* parent)
119 {
120 auto* menu = new QMenu(vcs->name(), parent);
121 menu->setIcon(QIcon::fromTheme(ICore::self()->pluginController()->pluginInfo(plugin).iconName()));
122 menu->addAction(commitAction);
123 if(plugin->extension<IDistributedVersionControl>()) {
124 menu->addAction(pushAction);
125 menu->addAction(pullAction);
126 } else {
127 menu->addAction(updateAction);
128 }
129 menu->addSeparator();
130 menu->addAction(addAction);
131 menu->addAction(revertAction);
132 menu->addSeparator();
133 menu->addAction(historyAction);
134 menu->addAction(annotationAction);
135 menu->addAction(diffToBaseAction);
136
137 const bool singleVersionedFile = ctxUrls.size() == 1 && vcs->isVersionControlled(ctxUrls.constFirst());
138 historyAction->setEnabled(singleVersionedFile);
139 annotationAction->setEnabled(singleVersionedFile && allLocalFiles(ctxUrls));
140 diffToBaseAction->setEnabled(singleVersionedFile);
141 commitAction->setEnabled(singleVersionedFile);
142
143 return menu;
144 }
145};
146
147

Callers 1

commonActionsMethod · 0.80

Calls 9

setIconMethod · 0.80
pluginControllerMethod · 0.80
nameMethod · 0.45
iconNameMethod · 0.45
pluginInfoMethod · 0.45
addActionMethod · 0.45
sizeMethod · 0.45
isVersionControlledMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected