| 481 | } |
| 482 | |
| 483 | void PatchReviewPlugin::setPatch( IPatchSource* patch ) { |
| 484 | if ( patch == m_patch ) { |
| 485 | return; |
| 486 | } |
| 487 | |
| 488 | if( m_patch ) { |
| 489 | disconnect( m_patch.data(), &IPatchSource::patchChanged, this, &PatchReviewPlugin::notifyPatchChanged ); |
| 490 | m_patch->deleteLater(); |
| 491 | } |
| 492 | m_patch = patch; |
| 493 | |
| 494 | if( m_patch ) { |
| 495 | qCDebug(PLUGIN_PATCHREVIEW) << "setting new patch" << patch->name() << "with file" << patch->file() << "basedir" << patch->baseDir(); |
| 496 | |
| 497 | connect( m_patch.data(), &IPatchSource::patchChanged, this, &PatchReviewPlugin::notifyPatchChanged ); |
| 498 | } |
| 499 | QString finishText = i18nc("@action", "Finish Review"); |
| 500 | if( m_patch && !m_patch->finishReviewCustomText().isEmpty() ) |
| 501 | finishText = m_patch->finishReviewCustomText(); |
| 502 | m_finishReview->setText( finishText ); |
| 503 | m_finishReview->setEnabled( patch ); |
| 504 | |
| 505 | notifyPatchChanged(); |
| 506 | } |
| 507 | |
| 508 | PatchReviewPlugin::PatchReviewPlugin(QObject* parent, const KPluginMetaData& metaData, const QVariantList&) |
| 509 | : KDevelop::IPlugin(QStringLiteral("kdevpatchreview"), parent, metaData) |
nothing calls this directly
no test coverage detected