| 171 | } |
| 172 | |
| 173 | static Path projectRelPath(const KDevelop::Path & projectsDir, const KDevelop::Path& runtimePath, bool sourceDir) |
| 174 | { |
| 175 | const auto relPath = projectsDir.relativePath(runtimePath); |
| 176 | const int index = relPath.indexOf(QLatin1Char('/')); |
| 177 | auto project = ICore::self()->projectController()->findProjectByName(relPath.left(index)); |
| 178 | |
| 179 | if (!project) { |
| 180 | qCWarning(DOCKER) << "No project for" << relPath; |
| 181 | } else { |
| 182 | const auto repPathProject = index < 0 ? QString() : relPath.mid(index+1); |
| 183 | const auto rootPath = sourceDir ? project->path() : project->buildSystemManager()->buildDirectory(project->projectItem()); |
| 184 | return Path(rootPath, repPathProject); |
| 185 | } |
| 186 | return {}; |
| 187 | } |
| 188 | |
| 189 | KDevelop::Path DockerRuntime::pathInHost(const KDevelop::Path& runtimePath) const |
| 190 | { |
no test coverage detected