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

Method fillEditFromPatch

plugins/patchreview/patchreviewtoolview.cpp:156–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void 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
194void PatchReviewToolView::slotAppliedChanged( int newState ) {
195 if ( LocalPatchSource* lpatch = GetLocalPatchSource() ) {

Callers

nothing calls this directly

Calls 15

patchMethod · 0.80
setIsCheckbableMethod · 0.80
removeWidgetMethod · 0.80
showMethod · 0.80
constBeginMethod · 0.80
constEndMethod · 0.80
findProjectForUrlMethod · 0.80
projectControllerMethod · 0.80
testSuitesForProjectMethod · 0.80
testControllerMethod · 0.80
setVisibleMethod · 0.45
canCancelMethod · 0.45

Tested by

no test coverage detected