VCS: Simplify VcsEditor setup

Create the editor parameter structures in-place, and also
include the other two parameters in the struct to simplify
the signature of the c'tor.

Change-Id: Iff7d5ddf3096f4a3ed18e53265ae74806823af32
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2024-02-07 10:33:46 +01:00
parent be33c807a6
commit 2d37a7421f
10 changed files with 198 additions and 302 deletions

View File

@@ -89,27 +89,6 @@ const char COMMIT[] = "Bazaar.Action.Commit";
const char UNCOMMIT[] = "Bazaar.Action.UnCommit";
const char CREATE_REPOSITORY[] = "Bazaar.Action.CreateRepository";
const VcsBaseEditorParameters logEditorParameters {
LogOutput, // type
Constants::FILELOG_ID, // id
Constants::FILELOG_DISPLAY_NAME, // display name
Constants::LOGAPP // mime type
};
const VcsBaseEditorParameters annotateEditorParameters {
AnnotateOutput,
Constants::ANNOTATELOG_ID,
Constants::ANNOTATELOG_DISPLAY_NAME,
Constants::ANNOTATEAPP
};
const VcsBaseEditorParameters diffEditorParameters {
DiffOutput,
Constants::DIFFLOG_ID,
Constants::DIFFLOG_DISPLAY_NAME,
Constants::DIFFAPP
};
class RevertDialog : public QDialog
{
public:
@@ -220,23 +199,32 @@ public:
FilePath m_submitRepository;
VcsEditorFactory logEditorFactory {
&logEditorParameters,
VcsEditorFactory logEditorFactory {{
LogOutput, // type
Constants::FILELOG_ID, // id
Constants::FILELOG_DISPLAY_NAME, // display name
Constants::LOGAPP,// mime type
[] { return new BazaarEditorWidget; },
std::bind(&BazaarPluginPrivate::vcsDescribe, this, _1, _2)
};
}};
VcsEditorFactory annotateEditorFactory {
&annotateEditorParameters,
VcsEditorFactory annotateEditorFactory {{
AnnotateOutput,
Constants::ANNOTATELOG_ID,
Constants::ANNOTATELOG_DISPLAY_NAME,
Constants::ANNOTATEAPP,
[] { return new BazaarEditorWidget; },
std::bind(&BazaarPluginPrivate::vcsDescribe, this, _1, _2)
};
}};
VcsEditorFactory diffEditorFactory {
&diffEditorParameters,
VcsEditorFactory diffEditorFactory {{
DiffOutput,
Constants::DIFFLOG_ID,
Constants::DIFFLOG_DISPLAY_NAME,
Constants::DIFFAPP,
[] { return new BazaarEditorWidget; },
std::bind(&BazaarPluginPrivate::vcsDescribe, this, _1, _2)
};
}};
};
class UnCommitDialog : public QDialog