aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/mercurial
diff options
context:
space:
mode:
authorhjk <[email protected]>2024-02-07 10:33:46 +0100
committerhjk <[email protected]>2024-02-07 14:49:02 +0000
commit2d37a7421f99ffba59c42eb0339258959e5855b6 (patch)
treee136015b1a05ba3eff640ece84d75773b10dcf02 /src/plugins/mercurial
parentbe33c807a64a217c5e20b87d752087ba239a72e9 (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/mercurial')
-rw-r--r--src/plugins/mercurial/mercurialplugin.cpp48
1 files changed, 18 insertions, 30 deletions
diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp
index 081a7a5e41c..bd691d47e4c 100644
--- a/src/plugins/mercurial/mercurialplugin.cpp
+++ b/src/plugins/mercurial/mercurialplugin.cpp
@@ -67,27 +67,6 @@ protected:
}
};
-const VcsBaseEditorParameters logEditorParameters {
- LogOutput,
- Constants::FILELOG_ID,
- Constants::FILELOG_DISPLAY_NAME,
- Constants::LOGAPP
-};
-
-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 MercurialPluginPrivate final : public VcsBase::VersionControlBase
{
public:
@@ -180,23 +159,32 @@ private:
FilePath m_submitRepository;
public:
- VcsEditorFactory logEditorFactory {
- &logEditorParameters,
+ VcsEditorFactory logEditorFactory {{
+ LogOutput,
+ Constants::FILELOG_ID,
+ Constants::FILELOG_DISPLAY_NAME,
+ Constants::LOGAPP,
[this] { return new MercurialEditorWidget; },
std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2)
- };
+ }};
- VcsEditorFactory annotateEditorFactory {
- &annotateEditorParameters,
+ VcsEditorFactory annotateEditorFactory {{
+ AnnotateOutput,
+ Constants::ANNOTATELOG_ID,
+ Constants::ANNOTATELOG_DISPLAY_NAME,
+ Constants::ANNOTATEAPP,
[this] { return new MercurialEditorWidget; },
std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2)
- };
+ }};
- VcsEditorFactory diffEditorFactory {
- &diffEditorParameters,
+ VcsEditorFactory diffEditorFactory {{
+ DiffOutput,
+ Constants::DIFFLOG_ID,
+ Constants::DIFFLOG_DISPLAY_NAME,
+ Constants::DIFFAPP,
[this] { return new MercurialEditorWidget; },
std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2)
- };
+ }};
};
static MercurialPluginPrivate *dd = nullptr;