| 154 | } |
| 155 | |
| 156 | void PatchReviewToolView::fillEditFromPatch() { |
| 157 | IPatchSource::Ptr ipatch = m_plugin->patch(); |
| 158 | if ( !ipatch ) |
| 159 | return; |
| 160 | |
| 161 | m_editPatch.cancelReview->setVisible( ipatch->canCancel() ); |
| 162 | |
| 163 | m_fileModel->setIsCheckbable( m_plugin->patch()->canSelectFiles() ); |
| 164 | |
| 165 | if( m_customWidget ) { |
| 166 | qCDebug(PLUGIN_PATCHREVIEW) << "removing custom widget"; |
| 167 | m_customWidget->hide(); |
| 168 | m_editPatch.contentLayout->removeWidget( m_customWidget ); |
| 169 | } |
| 170 | |
| 171 | m_customWidget = ipatch->customWidget(); |
| 172 | if( m_customWidget ) { |
| 173 | m_editPatch.contentLayout->insertWidget( 0, m_customWidget ); |
| 174 | m_customWidget->show(); |
| 175 | qCDebug(PLUGIN_PATCHREVIEW) << "got custom widget"; |
| 176 | } |
| 177 | |
| 178 | bool showTests = false; |
| 179 | QMap<QUrl, VcsStatusInfo::State> files = ipatch->additionalSelectableFiles(); |
| 180 | QMap<QUrl, VcsStatusInfo::State>::const_iterator it = files.constBegin(); |
| 181 | |
| 182 | for (; it != files.constEnd(); ++it) { |
| 183 | auto project = ICore::self()->projectController()->findProjectForUrl(it.key()); |
| 184 | if (project && !ICore::self()->testController()->testSuitesForProject(project).isEmpty()) { |
| 185 | showTests = true; |
| 186 | break; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | m_editPatch.testsButton->setVisible(showTests); |
| 191 | m_editPatch.testProgressBar->hide(); |
| 192 | } |
| 193 | |
| 194 | void PatchReviewToolView::slotAppliedChanged( int newState ) { |
| 195 | if ( LocalPatchSource* lpatch = GetLocalPatchSource() ) { |
nothing calls this directly
no test coverage detected