| 176 | } |
| 177 | |
| 178 | QString PerforcePlugin::getRepositoryName(const QFileInfo& curFile) |
| 179 | { |
| 180 | const QString DEPOT_FILE_STR(QStringLiteral("... depotFile ")); |
| 181 | QString ret; |
| 182 | QScopedPointer<DVcsJob> job(p4fstatJob(curFile, KDevelop::OutputJob::Silent)); |
| 183 | if (job->exec() && job->status() == KDevelop::VcsJob::JobSucceeded) { |
| 184 | if (!job->output().isEmpty()) { |
| 185 | const QStringList outputLines = job->output().split(QLatin1Char('\n'), Qt::SkipEmptyParts); |
| 186 | for (const QString& line : outputLines) { |
| 187 | int idx(line.indexOf(DEPOT_FILE_STR)); |
| 188 | if (idx != -1) { |
| 189 | ret = line.mid(DEPOT_FILE_STR.size()); |
| 190 | return ret; |
| 191 | } |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | return ret; |
| 197 | } |
| 198 | |
| 199 | KDevelop::VcsJob* PerforcePlugin::repositoryLocation(const QUrl& /*localLocation*/) |
| 200 | { |