Changeset View
Changeset View
Standalone View
Standalone View
plugins/perforce/perforceplugin.cpp
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Line(s) | 444 | { | |||
---|---|---|---|---|---|
445 | return nullptr; | 445 | return nullptr; | ||
446 | } | 446 | } | ||
447 | 447 | | |||
448 | KDevelop::VcsJob* PerforcePlugin::import(const QString& /*commitMessage*/, const QUrl& /*sourceDirectory*/, const KDevelop::VcsLocation& /*destinationRepository*/) | 448 | KDevelop::VcsJob* PerforcePlugin::import(const QString& /*commitMessage*/, const QUrl& /*sourceDirectory*/, const KDevelop::VcsLocation& /*destinationRepository*/) | ||
449 | { | 449 | { | ||
450 | return nullptr; | 450 | return nullptr; | ||
451 | } | 451 | } | ||
452 | 452 | | |||
453 | KDevelop::ContextMenuExtension PerforcePlugin::contextMenuExtension(KDevelop::Context* context) | 453 | KDevelop::ContextMenuExtension PerforcePlugin::contextMenuExtension(KDevelop::Context* context, QWidget* parent) | ||
454 | { | 454 | { | ||
455 | m_common->setupFromContext(context); | 455 | m_common->setupFromContext(context); | ||
456 | 456 | | |||
457 | const QList<QUrl> & ctxUrlList = m_common->contextUrlList(); | 457 | const QList<QUrl> & ctxUrlList = m_common->contextUrlList(); | ||
458 | 458 | | |||
459 | bool hasVersionControlledEntries = false; | 459 | bool hasVersionControlledEntries = false; | ||
460 | for( const QUrl& url : ctxUrlList) { | 460 | for( const QUrl& url : ctxUrlList) { | ||
461 | if (isValidDirectory(url)) { | 461 | if (isValidDirectory(url)) { | ||
462 | hasVersionControlledEntries = true; | 462 | hasVersionControlledEntries = true; | ||
463 | break; | 463 | break; | ||
464 | } | 464 | } | ||
465 | } | 465 | } | ||
466 | 466 | | |||
467 | if (!hasVersionControlledEntries) | 467 | if (!hasVersionControlledEntries) | ||
468 | return IPlugin::contextMenuExtension(context); | 468 | return IPlugin::contextMenuExtension(context, parent); | ||
469 | 469 | | |||
470 | QMenu * perforceMenu = m_common->commonActions(); | 470 | QMenu * perforceMenu = m_common->commonActions(parent); | ||
471 | perforceMenu->addSeparator(); | 471 | perforceMenu->addSeparator(); | ||
472 | 472 | | |||
473 | perforceMenu->addSeparator(); | 473 | perforceMenu->addSeparator(); | ||
474 | if (!m_edit_action) { | 474 | if (!m_edit_action) { | ||
475 | m_edit_action = new QAction(i18n("Edit"), this); | 475 | m_edit_action = new QAction(i18n("Edit"), this); | ||
476 | connect(m_edit_action, &QAction::triggered, this, & PerforcePlugin::ctxEdit); | 476 | connect(m_edit_action, &QAction::triggered, this, & PerforcePlugin::ctxEdit); | ||
477 | } | 477 | } | ||
478 | perforceMenu->addAction(m_edit_action); | 478 | perforceMenu->addAction(m_edit_action); | ||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |