From dffd71f4f11792bb71a168e85f853da873ef0d20 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 13 Jul 2015 13:37:57 +0200 Subject: [PATCH] Perforce: Reduced delay before submit dialog is shown Qt Creator's Perforce plugin uses "fstat" command to gather the files in the project. This takes ~40 seconds on a 12.000 files project. By using "files" command the operation of gathering the files in the project takes ~1 second. Change-Id: Id8257d33a5dda2e06f0f365d5e3b30a49a094483 Reviewed-by: Tobias Hunger Reviewed-by: Alexander Drozdov --- src/plugins/perforce/perforceplugin.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index f12f203526c..54d2c06d053 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -635,20 +635,19 @@ void PerforcePlugin::startSubmitProject() m_commitMessageFileName = saver.fileName(); args.clear(); - args << QLatin1String("fstat"); + args << QLatin1String("files"); args.append(perforceRelativeProjectDirectory(state)); - PerforceResponse fstatResult = runP4Cmd(state.currentProjectTopLevel(), args, + PerforceResponse filesResult = runP4Cmd(state.currentProjectTopLevel(), args, RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); - if (fstatResult.error) { + if (filesResult.error) { cleanCommitMessageFile(); return; } - QStringList fstatLines = fstatResult.stdOut.split(QLatin1Char('\n')); + QStringList filesLines = filesResult.stdOut.split(QLatin1Char('\n')); QStringList depotFileNames; - foreach (const QString &line, fstatLines) { - if (line.startsWith(QLatin1String("... depotFile"))) - depotFileNames.append(line.mid(14)); + foreach (const QString &line, filesLines) { + depotFileNames.append(line.left(line.lastIndexOf(QRegExp(QLatin1String("#[0-9]+\\s-\\s"))))); } if (depotFileNames.isEmpty()) { VcsOutputWindow::appendWarning(tr("Project has no files"));