| 1004 | } |
| 1005 | |
| 1006 | QString DocumentController::activeDocumentPath( const QString& target ) const |
| 1007 | { |
| 1008 | if(!target.isEmpty()) { |
| 1009 | const auto projects = Core::self()->projectController()->projects(); |
| 1010 | for (IProject* project : projects) { |
| 1011 | if(project->name().startsWith(target, Qt::CaseInsensitive)) { |
| 1012 | return project->path().pathOrUrl() + QLatin1String("/."); |
| 1013 | } |
| 1014 | } |
| 1015 | } |
| 1016 | IDocument* doc = activeDocument(); |
| 1017 | if(!doc || target == QLatin1String("[selection]")) |
| 1018 | { |
| 1019 | Context* selection = ICore::self()->selectionController()->currentSelection(); |
| 1020 | if(selection && selection->type() == Context::ProjectItemContext && !static_cast<ProjectItemContext*>(selection)->items().isEmpty()) |
| 1021 | { |
| 1022 | QString ret = static_cast<ProjectItemContext*>(selection)->items().at(0)->path().pathOrUrl(); |
| 1023 | if(static_cast<ProjectItemContext*>(selection)->items().at(0)->folder()) |
| 1024 | ret += QLatin1String("/."); |
| 1025 | return ret; |
| 1026 | } |
| 1027 | return QString(); |
| 1028 | } |
| 1029 | return doc->url().toString(); |
| 1030 | } |
| 1031 | |
| 1032 | QStringList DocumentController::activeDocumentPaths() const |
| 1033 | { |
nothing calls this directly
no test coverage detected