Commit a8fc5e21 authored by cerf's avatar cerf Committed by Tobias Hunger
Browse files

vcsbase: refactor status output signal in VCSBaseClient



There is now a clear distinction between the basic status command
and the status command used to emit parsed output

Change-Id: Ie398a866ffcd8f4cc33b864ddbe23ce9d2e97437
Merge-request: 358
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/3337
parent 0dcd66ef
......@@ -220,7 +220,6 @@ QStringList BazaarClient::logArguments(const QStringList &files,
QStringList BazaarClient::statusArguments(const QString &file) const
{
QStringList args;
args.append(QLatin1String("--short"));
if (!file.isEmpty())
args.append(file);
return args;
......
......@@ -543,7 +543,8 @@ void BazaarPlugin::commit()
connect(m_client, SIGNAL(parsedStatus(QList<VCSBase::VCSBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VCSBase::VCSBaseClient::StatusItem>)));
m_client->statusWithSignal(m_submitRepository);
// The "--short" option allows to easily parse status output
m_client->emitParsedStatus(m_submitRepository, QStringList(QLatin1String("--short")));
}
void BazaarPlugin::showCommitWidget(const QList<VCSBase::VCSBaseClient::StatusItem> &status)
......
......@@ -568,7 +568,7 @@ void MercurialPlugin::commit()
connect(m_client, SIGNAL(parsedStatus(QList<VCSBase::VCSBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VCSBase::VCSBaseClient::StatusItem>)));
m_client->statusWithSignal(m_submitRepository);
m_client->emitParsedStatus(m_submitRepository);
}
void MercurialPlugin::showCommitWidget(const QList<VCSBase::VCSBaseClient::StatusItem> &status)
......
......@@ -396,11 +396,11 @@ void VCSBaseClient::status(const QString &workingDir, const QString &file)
enqueueJob(job);
}
void VCSBaseClient::statusWithSignal(const QString &repositoryRoot)
void VCSBaseClient::emitParsedStatus(const QString &repository, const QStringList &extraOptions)
{
QStringList args(vcsCommandString(StatusCommand));
args << statusArguments(QString());
QSharedPointer<VCSJob> job(new VCSJob(repositoryRoot, args, VCSJob::RawDataEmitMode));
args << extraOptions;
QSharedPointer<VCSJob> job(new VCSJob(repository, args, VCSJob::RawDataEmitMode));
connect(job.data(), SIGNAL(rawData(QByteArray)), this, SLOT(statusParser(QByteArray)));
enqueueJob(job);
}
......
......@@ -100,7 +100,8 @@ public:
const QStringList &extraOptions = QStringList(),
bool enableAnnotationContextMenu = false);
void status(const QString &workingDir, const QString &file = QString());
void statusWithSignal(const QString &repository);
virtual void emitParsedStatus(const QString &repository,
const QStringList &extraOptions = QStringList());
void revertFile(const QString &workingDir, const QString &file, const QString &revision = QString());
void revertAll(const QString &workingDir, const QString &revision = QString());
void import(const QString &repositoryRoot, const QStringList &files);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment