| 409 | } |
| 410 | |
| 411 | void 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 | |
| 440 | void PatchReviewToolView::nextFile() |
| 441 | { |
nothing calls this directly
no test coverage detected