| 415 | } |
| 416 | |
| 417 | QUrl PatchReviewPlugin::urlForFileModel(const KompareDiff2::DiffModel* model) const |
| 418 | { |
| 419 | KDevelop::Path path(QDir::cleanPath(m_patch->baseDir().toLocalFile())); |
| 420 | QVector<QString> destPath = KDevelop::Path(QLatin1Char('/') + model->destinationPath()).segments(); |
| 421 | if (destPath.size() >= (int)m_depth) { |
| 422 | destPath.remove(0, m_depth); |
| 423 | } |
| 424 | for (const QString& segment : std::as_const(destPath)) { |
| 425 | path.addPath(segment); |
| 426 | } |
| 427 | path.addPath(model->destinationFile()); |
| 428 | |
| 429 | return path.toUrl(); |
| 430 | } |
| 431 | |
| 432 | void PatchReviewPlugin::updateReview() |
| 433 | { |
no test coverage detected