forked from qt-creator/qt-creator
Vcs: Move responsibility to set editor parameters to editor factory
So it doesn't need to be named twice in the editor factory setup. This intentially includes a de-optimiztion: storing the parameters by value, not by pointer. That's more natural, does not need to keep the parameters alive on the caller side, and it's uncritical in this context. Change-Id: I92867d3f2f75c38911ae82d3eeb4759cba71b723 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -381,8 +381,7 @@ PerforcePluginPrivate::PerforcePluginPrivate()
|
||||
m_settings.fromSettings(ICore::settings());
|
||||
|
||||
// Editor factories
|
||||
new VcsSubmitEditorFactory(&submitParameters,
|
||||
[]() { return new PerforceSubmitEditor(&submitParameters); }, this);
|
||||
new VcsSubmitEditorFactory(submitParameters, [] { return new PerforceSubmitEditor; }, this);
|
||||
|
||||
const auto describeFunc = [this](const QString &source, const QString &n) {
|
||||
describe(source, n);
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace Internal {
|
||||
|
||||
enum { FileSpecRole = Qt::UserRole + 1 };
|
||||
|
||||
PerforceSubmitEditor::PerforceSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters) :
|
||||
VcsBaseSubmitEditor(parameters, new PerforceSubmitEditorWidget),
|
||||
PerforceSubmitEditor::PerforceSubmitEditor() :
|
||||
VcsBaseSubmitEditor(new PerforceSubmitEditorWidget),
|
||||
m_fileModel(new VcsBase::SubmitFileModel(this))
|
||||
{
|
||||
document()->setPreferredDisplayName(tr("Perforce Submit"));
|
||||
|
||||
@@ -50,7 +50,7 @@ class PerforceSubmitEditor : public VcsBase::VcsBaseSubmitEditor
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PerforceSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters);
|
||||
PerforceSubmitEditor();
|
||||
|
||||
/* The p4 submit starts with all opened files. Restrict
|
||||
* it to the current project files in question. */
|
||||
|
||||
Reference in New Issue
Block a user