forked from qt-creator/qt-creator
VCS: Fix display of diff/show commands in progress bar
In 6ae0e8d2c7
we added 2 arguments that
precede the diff sub-command (-c diff.color=false).
When display name is not set, ShellCommand uses the binary followed by the
first argument, so it now showed "Git -c" instead of "Git Diff".
Change-Id: Ie584837bd87fd529e0cd015025fc3bf1a69d085c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Xiaofeng Wang <wasphin@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
8a0f7bcfd5
commit
17b3e45b8c
@@ -291,6 +291,7 @@ GitDiffEditorController::GitDiffEditorController(IDocument *document, const QStr
|
||||
{
|
||||
connect(&m_decorator, &DescriptionWidgetDecorator::branchListRequested,
|
||||
this, &GitDiffEditorController::updateBranchList);
|
||||
setDisplayName("Git Diff");
|
||||
}
|
||||
|
||||
void GitDiffEditorController::updateBranchList()
|
||||
@@ -514,7 +515,9 @@ public:
|
||||
GitDiffEditorController(document, dir),
|
||||
m_id(id),
|
||||
m_state(Idle)
|
||||
{ }
|
||||
{
|
||||
setDisplayName("Git Show");
|
||||
}
|
||||
|
||||
void reload() override;
|
||||
void processCommandOutput(const QString &output) override;
|
||||
|
@@ -68,6 +68,7 @@ protected:
|
||||
MercurialDiffEditorController::MercurialDiffEditorController(IDocument *document, const QString &workingDirectory):
|
||||
VcsBaseDiffEditorController(document, MercurialPlugin::client(), workingDirectory)
|
||||
{
|
||||
setDisplayName("Hg Diff");
|
||||
}
|
||||
|
||||
void MercurialDiffEditorController::runCommand(const QList<QStringList> &args, QTextCodec *codec)
|
||||
|
@@ -98,6 +98,7 @@ public:
|
||||
const QString m_directory;
|
||||
QString m_startupFile;
|
||||
QString m_output;
|
||||
QString m_displayName;
|
||||
QPointer<VcsCommand> m_command;
|
||||
QPointer<VcsCommandResultProxy> m_commandResultProxy;
|
||||
QFutureWatcher<QList<FileData>> *m_processWatcher = nullptr;
|
||||
@@ -251,6 +252,7 @@ void VcsBaseDiffEditorController::runCommand(const QList<QStringList> &args, uns
|
||||
d->cancelReload();
|
||||
|
||||
d->m_command = new VcsCommand(workingDirectory(), d->m_client->processEnvironment());
|
||||
d->m_command->setDisplayName(d->m_displayName);
|
||||
d->m_command->setCodec(codec ? codec : EditorManager::defaultTextCodec());
|
||||
d->m_commandResultProxy = new VcsCommandResultProxy(d->m_command.data(), d);
|
||||
d->m_command->addFlags(flags);
|
||||
@@ -289,6 +291,11 @@ QString VcsBaseDiffEditorController::startupFile() const
|
||||
return d->m_startupFile;
|
||||
}
|
||||
|
||||
void VcsBaseDiffEditorController::setDisplayName(const QString &displayName)
|
||||
{
|
||||
d->m_displayName = displayName;
|
||||
}
|
||||
|
||||
} // namespace VcsBase
|
||||
|
||||
#include "vcsbasediffeditorcontroller.moc"
|
||||
|
@@ -53,6 +53,7 @@ protected:
|
||||
QString workingDirectory() const;
|
||||
void setStartupFile(const QString &startupFile);
|
||||
QString startupFile() const;
|
||||
void setDisplayName(const QString &displayName);
|
||||
|
||||
private:
|
||||
friend class VcsBaseDiffEditorControllerPrivate;
|
||||
|
Reference in New Issue
Block a user