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

Method fileItemChanged

plugins/patchreview/patchreviewtoolview.cpp:411–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411void PatchReviewToolView::fileItemChanged( QStandardItem* item )
412{
413 if (item->column() != 0 || !m_plugin->patch())
414 return;
415
416 QUrl url = item->index().data(VcsFileChangesModel::UrlRole).toUrl();
417 if (url.isEmpty())
418 return;
419
420 KDevelop::IDocument* doc = ICore::self()->documentController()->documentForUrl(url);
421 if(m_fileModel->isCheckable() && item->checkState() != Qt::Checked)
422 { // The file was deselected, so eventually close it
423 if(doc && doc->state() == IDocument::Clean)
424 {
425 const auto views = ICore::self()->uiController()->activeArea()->views();
426 for (Sublime::View* view : views) {
427 if(view->document() == dynamic_cast<Sublime::Document*>(doc))
428 {
429 ICore::self()->uiController()->activeArea()->closeView(view);
430 return;
431 }
432 }
433 }
434 } else if (!doc) {
435 // Maybe the file was unchecked before, or it was just loaded.
436 open( url, false );
437 }
438}
439
440void PatchReviewToolView::nextFile()
441{

Callers

nothing calls this directly

Calls 15

patchMethod · 0.80
documentForUrlMethod · 0.80
documentControllerMethod · 0.80
isCheckableMethod · 0.80
checkStateMethod · 0.80
activeAreaMethod · 0.80
uiControllerMethod · 0.80
columnMethod · 0.45
toUrlMethod · 0.45
dataMethod · 0.45
indexMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected