diff options
author | hjk <[email protected]> | 2024-02-07 10:33:46 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2024-02-07 14:49:02 +0000 |
commit | 2d37a7421f99ffba59c42eb0339258959e5855b6 (patch) | |
tree | e136015b1a05ba3eff640ece84d75773b10dcf02 /src/plugins/bazaar/bazaarplugin.cpp | |
parent | be33c807a64a217c5e20b87d752087ba239a72e9 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/plugins/bazaar/bazaarplugin.cpp')
-rw-r--r-- | src/plugins/bazaar/bazaarplugin.cpp | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index a3b9c22d0c6..14046d738f0 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -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 |