forked from qt-creator/qt-creator
Git: Make createVcsEditor take the same arguments as in VcsBaseClient
Make createVcsEditor in GitClient have the same signature as createVcsEditor in VcsBaseClient. Change-Id: I652175cbbf90b5bccd007fe8f028e364fe61a9aa Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -755,14 +755,11 @@ void GitClient::stage(const QString &patch, bool revert)
|
|||||||
* (using the file's codec). Makes use of a dynamic property to find an
|
* (using the file's codec). Makes use of a dynamic property to find an
|
||||||
* existing instance and to reuse it (in case, say, 'git diff foo' is
|
* existing instance and to reuse it (in case, say, 'git diff foo' is
|
||||||
* already open). */
|
* already open). */
|
||||||
VcsBaseEditorWidget *GitClient::createVcsEditor(
|
VcsBaseEditorWidget *GitClient::createVcsEditor(Id id, QString title,
|
||||||
Id id,
|
|
||||||
QString title,
|
|
||||||
const QString &source, // Source file or directory
|
const QString &source, // Source file or directory
|
||||||
CodecType codecType,
|
CodecType codecType,
|
||||||
const char *registerDynamicProperty, // Dynamic property and value to identify that editor
|
const char *registerDynamicProperty, // Dynamic property and value to identify that editor
|
||||||
const QString &dynamicPropertyValue,
|
const QString &dynamicPropertyValue) const
|
||||||
VcsBaseEditorParameterWidget *configWidget) const
|
|
||||||
{
|
{
|
||||||
VcsBaseEditorWidget *rc = 0;
|
VcsBaseEditorWidget *rc = 0;
|
||||||
QTC_CHECK(!findExistingVCSEditor(registerDynamicProperty, dynamicPropertyValue));
|
QTC_CHECK(!findExistingVCSEditor(registerDynamicProperty, dynamicPropertyValue));
|
||||||
@@ -782,9 +779,6 @@ VcsBaseEditorWidget *GitClient::createVcsEditor(
|
|||||||
|
|
||||||
rc->setForceReadOnly(true);
|
rc->setForceReadOnly(true);
|
||||||
|
|
||||||
if (configWidget)
|
|
||||||
rc->setConfigurationWidget(configWidget);
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -904,8 +898,8 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
|
|||||||
auto *argWidget = new GitLogArgumentsWidget(settings());
|
auto *argWidget = new GitLogArgumentsWidget(settings());
|
||||||
connect(argWidget, &VcsBaseEditorParameterWidget::commandExecutionRequested,
|
connect(argWidget, &VcsBaseEditorParameterWidget::commandExecutionRequested,
|
||||||
[=]() { this->log(workingDirectory, fileName, enableAnnotationContextMenu, args); });
|
[=]() { this->log(workingDirectory, fileName, enableAnnotationContextMenu, args); });
|
||||||
editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logTitle", msgArg,
|
editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logTitle", msgArg);
|
||||||
argWidget);
|
editor->setConfigurationWidget(argWidget);
|
||||||
}
|
}
|
||||||
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
|
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
|
||||||
editor->setWorkingDirectory(workingDirectory);
|
editor->setWorkingDirectory(workingDirectory);
|
||||||
@@ -937,7 +931,7 @@ void GitClient::reflog(const QString &workingDirectory)
|
|||||||
VcsBaseEditorWidget *editor = findExistingVCSEditor("reflogRepository", workingDirectory);
|
VcsBaseEditorWidget *editor = findExistingVCSEditor("reflogRepository", workingDirectory);
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
editor = createVcsEditor(editorId, title, workingDirectory, CodecLogOutput,
|
editor = createVcsEditor(editorId, title, workingDirectory, CodecLogOutput,
|
||||||
"reflogRepository", workingDirectory, 0);
|
"reflogRepository", workingDirectory);
|
||||||
}
|
}
|
||||||
editor->setWorkingDirectory(workingDirectory);
|
editor->setWorkingDirectory(workingDirectory);
|
||||||
|
|
||||||
@@ -1031,7 +1025,8 @@ void GitClient::blame(const QString &workingDirectory,
|
|||||||
const int line = VcsBaseEditor::lineNumberOfCurrentEditor();
|
const int line = VcsBaseEditor::lineNumberOfCurrentEditor();
|
||||||
blame(workingDirectory, args, fileName, revision, line);
|
blame(workingDirectory, args, fileName, revision, line);
|
||||||
} );
|
} );
|
||||||
editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "blameFileName", id, argWidget);
|
editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "blameFileName", id);
|
||||||
|
editor->setConfigurationWidget(argWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
editor->setWorkingDirectory(workingDirectory);
|
editor->setWorkingDirectory(workingDirectory);
|
||||||
@@ -3075,7 +3070,7 @@ void GitClient::subversionLog(const QString &workingDirectory)
|
|||||||
const QString sourceFile = VcsBaseEditor::getSource(workingDirectory, QStringList());
|
const QString sourceFile = VcsBaseEditor::getSource(workingDirectory, QStringList());
|
||||||
VcsBaseEditorWidget *editor = findExistingVCSEditor("svnLog", sourceFile);
|
VcsBaseEditorWidget *editor = findExistingVCSEditor("svnLog", sourceFile);
|
||||||
if (!editor)
|
if (!editor)
|
||||||
editor = createVcsEditor(editorId, title, sourceFile, CodecNone, "svnLog", sourceFile, 0);
|
editor = createVcsEditor(editorId, title, sourceFile, CodecNone, "svnLog", sourceFile);
|
||||||
editor->setWorkingDirectory(workingDirectory);
|
editor->setWorkingDirectory(workingDirectory);
|
||||||
executeGit(workingDirectory, arguments, editor);
|
executeGit(workingDirectory, arguments, editor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -374,8 +374,7 @@ private:
|
|||||||
const QString &source,
|
const QString &source,
|
||||||
CodecType codecType,
|
CodecType codecType,
|
||||||
const char *registerDynamicProperty,
|
const char *registerDynamicProperty,
|
||||||
const QString &dynamicPropertyValue,
|
const QString &dynamicPropertyValue) const;
|
||||||
VcsBase::VcsBaseEditorParameterWidget *configWidget) const;
|
|
||||||
|
|
||||||
void requestReload(const QString &documentId, const QString &source, const QString &title,
|
void requestReload(const QString &documentId, const QString &source, const QString &title,
|
||||||
std::function<DiffEditor::DiffEditorController *(Core::IDocument *)> factory) const;
|
std::function<DiffEditor::DiffEditorController *(Core::IDocument *)> factory) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user