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

Method urlForFileModel

plugins/patchreview/patchreview.cpp:417–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417QUrl 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
432void PatchReviewPlugin::updateReview()
433{

Callers 1

kompareModelChangedMethod · 0.80

Calls 8

cleanPathFunction · 0.85
toLocalFileMethod · 0.80
PathClass · 0.50
baseDirMethod · 0.45
sizeMethod · 0.45
removeMethod · 0.45
addPathMethod · 0.45
toUrlMethod · 0.45

Tested by

no test coverage detected