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

Method PatchReviewPlugin

plugins/patchreview/patchreview.cpp:508–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508PatchReviewPlugin::PatchReviewPlugin(QObject* parent, const KPluginMetaData& metaData, const QVariantList&)
509 : KDevelop::IPlugin(QStringLiteral("kdevpatchreview"), parent, metaData)
510 , m_patch(nullptr)
511 , m_factory(new PatchReviewToolViewFactory(this))
512{
513 setXMLFile( QStringLiteral("kdevpatchreview.rc") );
514
515 connect( ICore::self()->documentController(), &IDocumentController::documentClosed, this, &PatchReviewPlugin::documentClosed );
516 connect( ICore::self()->documentController(), &IDocumentController::textDocumentCreated, this, &PatchReviewPlugin::textDocumentCreated );
517 connect( ICore::self()->documentController(), &IDocumentController::documentSaved, this, &PatchReviewPlugin::documentSaved );
518
519 m_updateKompareTimer = new QTimer( this );
520 m_updateKompareTimer->setSingleShot( true );
521 m_updateKompareTimer->setInterval(500);
522 connect( m_updateKompareTimer, &QTimer::timeout, this, &PatchReviewPlugin::updateKompareModel );
523
524 m_finishReview = new QAction(i18nc("@action", "Finish Review"), this);
525 m_finishReview->setIcon( QIcon::fromTheme( QStringLiteral("dialog-ok") ) );
526 actionCollection()->setDefaultShortcut( m_finishReview, Qt::CTRL|Qt::Key_Return );
527 actionCollection()->addAction(QStringLiteral("commit_or_finish_review"), m_finishReview);
528
529 const auto allAreas = ICore::self()->uiController()->allAreas();
530 for (Sublime::Area* area : allAreas) {
531 if (area->objectName() == QLatin1String("review"))
532 area->addAction(m_finishReview);
533 }
534
535 core()->uiController()->addToolView(i18nc("@title:window", "Patch Review"), m_factory, IUiController::None);
536
537 areaChanged(ICore::self()->uiController()->activeArea());
538}
539
540void PatchReviewPlugin::documentClosed( IDocument* doc ) {
541 removeHighlighting( doc->url() );

Callers

nothing calls this directly

Calls 7

documentControllerMethod · 0.80
setIconMethod · 0.80
allAreasMethod · 0.80
uiControllerMethod · 0.80
activeAreaMethod · 0.80
addActionMethod · 0.45
addToolViewMethod · 0.45

Tested by

no test coverage detected