| 307 | |
| 308 | |
| 309 | KDevelop::ContextMenuExtension KDevSvnPlugin::contextMenuExtension(KDevelop::Context* context, QWidget* parent) |
| 310 | { |
| 311 | m_common->setupFromContext(context); |
| 312 | |
| 313 | const QList<QUrl> & ctxUrlList = m_common->contextUrlList(); |
| 314 | |
| 315 | bool hasVersionControlledEntries = false; |
| 316 | for (const QUrl& url : ctxUrlList) { |
| 317 | if (isVersionControlled(url) || isVersionControlled(KIO::upUrl(url))) { |
| 318 | hasVersionControlledEntries = true; |
| 319 | break; |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | qCDebug(PLUGIN_SVN) << "version controlled?" << hasVersionControlledEntries; |
| 324 | |
| 325 | if (!hasVersionControlledEntries) |
| 326 | return IPlugin::contextMenuExtension(context, parent); |
| 327 | |
| 328 | |
| 329 | QMenu* svnmenu = m_common->commonActions(parent); |
| 330 | svnmenu->addSeparator(); |
| 331 | |
| 332 | if( !copy_action ) |
| 333 | { |
| 334 | copy_action = new QAction(i18nc("@action:inmenu", "Copy..."), this); |
| 335 | connect(copy_action, &QAction::triggered, this, &KDevSvnPlugin::ctxCopy); |
| 336 | } |
| 337 | svnmenu->addAction(copy_action); |
| 338 | |
| 339 | if( !move_action ) |
| 340 | { |
| 341 | move_action = new QAction(i18nc("@action:inmenu", "Move..."), this); |
| 342 | connect(move_action, &QAction::triggered, this, &KDevSvnPlugin::ctxMove); |
| 343 | } |
| 344 | svnmenu->addAction(move_action); |
| 345 | |
| 346 | KDevelop::ContextMenuExtension menuExt; |
| 347 | menuExt.addAction(KDevelop::ContextMenuExtension::VcsGroup, svnmenu->menuAction()); |
| 348 | |
| 349 | return menuExt; |
| 350 | } |
| 351 | |
| 352 | void KDevSvnPlugin::ctxCopy() |
| 353 | { |
nothing calls this directly
no test coverage detected