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/fossil/fossilplugin.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/fossil/fossilplugin.cpp')
| -rw-r--r-- | src/plugins/fossil/fossilplugin.cpp | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/src/plugins/fossil/fossilplugin.cpp b/src/plugins/fossil/fossilplugin.cpp index 46924462580..40138f281ba 100644 --- a/src/plugins/fossil/fossilplugin.cpp +++ b/src/plugins/fossil/fossilplugin.cpp @@ -77,28 +77,6 @@ protected: } }; -const VcsBaseEditorParameters fileLogParameters { - LogOutput, - Constants::FILELOG_ID, - Constants::FILELOG_DISPLAY_NAME, - Constants::LOGAPP -}; - -const VcsBaseEditorParameters annotateLogParameters { - AnnotateOutput, - Constants::ANNOTATELOG_ID, - Constants::ANNOTATELOG_DISPLAY_NAME, - Constants::ANNOTATEAPP -}; - -const VcsBaseEditorParameters diffParameters { - DiffOutput, - Constants::DIFFLOG_ID, - Constants::DIFFLOG_DISPLAY_NAME, - Constants::DIFFAPP -}; - - class FossilPluginPrivate final : public VersionControlBase { public: @@ -171,23 +149,32 @@ public: bool pullOrPush(SyncMode mode); // Variables - VcsEditorFactory fileLogFactory { - &fileLogParameters, + VcsEditorFactory fileLogFactory {{ + LogOutput, + Constants::FILELOG_ID, + Constants::FILELOG_DISPLAY_NAME, + Constants::LOGAPP, [] { return new FossilEditorWidget; }, std::bind(&FossilPluginPrivate::vcsDescribe, this, _1, _2) - }; + }}; - VcsEditorFactory annotateLogFactory { - &annotateLogParameters, + VcsEditorFactory annotateLogFactory {{ + AnnotateOutput, + Constants::ANNOTATELOG_ID, + Constants::ANNOTATELOG_DISPLAY_NAME, + Constants::ANNOTATEAPP, [] { return new FossilEditorWidget; }, std::bind(&FossilPluginPrivate::vcsDescribe, this, _1, _2) - }; + }}; - VcsEditorFactory diffFactory { - &diffParameters, + VcsEditorFactory diffFactory {{ + DiffOutput, + Constants::DIFFLOG_ID, + Constants::DIFFLOG_DISPLAY_NAME, + Constants::DIFFAPP, [] { return new FossilEditorWidget; }, std::bind(&FossilPluginPrivate::vcsDescribe, this, _1, _2) - }; + }}; CommandLocator *m_commandLocator = nullptr; ActionContainer *m_fossilContainer = nullptr; |
