Perforce: Use new VCSBasePlugin class.

Use relative paths with -d-option, check for symlinked depots.
Add revert-actions.
Use different context/kinds for editors, suppressing warnings.
Introduce common run-function.
This commit is contained in:
Friedemann Kleint
2009-12-11 16:43:39 +01:00
parent 46e612761f
commit f7cc04e25e
16 changed files with 1260 additions and 704 deletions

View File

@@ -204,7 +204,7 @@ void VCSBaseSubmitEditor::createUserFields(const QString &fieldConfigFile)
Utils::SubmitFieldWidget *fieldWidget = new Utils::SubmitFieldWidget;
connect(fieldWidget, SIGNAL(browseButtonClicked(int,QString)),
this, SLOT(slotSetFieldNickName(int)));
this, SLOT(slotSetFieldNickName(int)));
fieldWidget->setCompleter(completer);
fieldWidget->setAllowDuplicateFields(true);
fieldWidget->setHasBrowseButton(true);
@@ -557,7 +557,7 @@ bool VCSBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript
if (!checkProcess.waitForFinished()) {
*errorMessage = tr("The check script '%1' could not be run: %2").arg(checkScript, checkProcess.errorString());
return false;
}
}
const int exitCode = checkProcess.exitCode();
if (exitCode != 0) {
*errorMessage = QString::fromLocal8Bit(checkProcess.readAllStandardError());
@@ -581,32 +581,23 @@ QIcon VCSBaseSubmitEditor::submitIcon()
// Compile a list if files in the current projects. TODO: Recurse down qrc files?
QStringList VCSBaseSubmitEditor::currentProjectFiles(bool nativeSeparators, QString *name)
{
using namespace ProjectExplorer;
if (name)
name->clear();
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
if (!pe)
return QStringList();
QStringList files;
if (const Project *currentProject = pe->currentProject()) {
files << currentProject->files(Project::ExcludeGeneratedFiles);
if (name)
*name = currentProject->name();
} else {
if (const SessionManager *session = pe->session()) {
if (ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance()) {
if (const ProjectExplorer::Project *currentProject = pe->currentProject()) {
QStringList files = currentProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
if (name)
*name = session->file()->fileName();
const QList<Project *> projects = session->projects();
foreach (Project *project, projects)
files << project->files(Project::ExcludeGeneratedFiles);
*name = currentProject->name();
if (nativeSeparators && !files.empty()) {
const QStringList::iterator end = files.end();
for (QStringList::iterator it = files.begin(); it != end; ++it)
*it = QDir::toNativeSeparators(*it);
}
return files;
}
}
if (nativeSeparators && !files.empty()) {
const QStringList::iterator end = files.end();
for (QStringList::iterator it = files.begin(); it != end; ++it)
*it = QDir::toNativeSeparators(*it);
}
return files;
return QStringList();
}
// Reduce a list of untracked files reported by a VCS down to the files