aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/mercurial
diff options
context:
space:
mode:
authorhjk <[email protected]>2024-02-07 17:15:49 +0100
committerhjk <[email protected]>2024-02-09 10:27:01 +0000
commit4e5692d62830292d35d80b06e173ddc3744cbffa (patch)
treee4affd983a5d038d40ec2d623ac47b90caecf708 /src/plugins/mercurial
parenta020c13e10b324775667b799fdee67c86a09d106 (diff)
Vcs: Use QString and Id in editor parameters instead of char *
... and use it to simplify the translation setup. Change-Id: Ibd386ede3ecfc351316bed53bc184954adbcaa74 Reviewed-by: Orgad Shaneh <[email protected]> Reviewed-by: <[email protected]>
Diffstat (limited to 'src/plugins/mercurial')
-rw-r--r--src/plugins/mercurial/constants.h6
-rw-r--r--src/plugins/mercurial/mercurialplugin.cpp9
2 files changed, 5 insertions, 10 deletions
diff --git a/src/plugins/mercurial/constants.h b/src/plugins/mercurial/constants.h
index e38871e4aa7..ee2738dbcac 100644
--- a/src/plugins/mercurial/constants.h
+++ b/src/plugins/mercurial/constants.h
@@ -3,8 +3,6 @@
#pragma once
-#include <QtGlobal>
-
namespace Mercurial::Constants {
enum { debug = 0 };
@@ -23,20 +21,16 @@ const char DIFFIDENTIFIER[] = "^(?:diff --git a/|[+-]{3} (?:/dev/null|[ab]/(.+$)
// Base editor parameters
const char FILELOG_ID[] = "Mercurial File Log Editor";
-const char FILELOG_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::VcsBase", "Mercurial File Log Editor");
const char LOGAPP[] = "text/vnd.qtcreator.mercurial.log";
const char ANNOTATELOG_ID[] = "Mercurial Annotation Editor";
-const char ANNOTATELOG_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::VcsBase", "Mercurial Annotation Editor");
const char ANNOTATEAPP[] = "text/vnd.qtcreator.mercurial.annotation";
const char DIFFLOG_ID[] = "Mercurial Diff Editor";
-const char DIFFLOG_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::VcsBase", "Mercurial Diff Editor");
const char DIFFAPP[] = "text/x-patch";
// Submit editor parameters
const char COMMIT_ID[] = "Mercurial Commit Log Editor";
-const char COMMIT_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::VcsBase", "Mercurial Commit Log Editor");
const char COMMITMIMETYPE[] = "text/vnd.qtcreator.mercurial.commit";
// File menu actions
diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp
index bd691d47e4c..1fa1fc8155e 100644
--- a/src/plugins/mercurial/mercurialplugin.cpp
+++ b/src/plugins/mercurial/mercurialplugin.cpp
@@ -30,6 +30,7 @@
#include <vcsbase/vcsbaseconstants.h>
#include <vcsbase/vcsbaseeditor.h>
+#include <vcsbase/vcsbasetr.h>
#include <vcsbase/vcscommand.h>
#include <vcsbase/vcsoutputwindow.h>
@@ -162,7 +163,7 @@ public:
VcsEditorFactory logEditorFactory {{
LogOutput,
Constants::FILELOG_ID,
- Constants::FILELOG_DISPLAY_NAME,
+ VcsBase::Tr::tr("Mercurial File Log Editor"),
Constants::LOGAPP,
[this] { return new MercurialEditorWidget; },
std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2)
@@ -171,7 +172,7 @@ public:
VcsEditorFactory annotateEditorFactory {{
AnnotateOutput,
Constants::ANNOTATELOG_ID,
- Constants::ANNOTATELOG_DISPLAY_NAME,
+ VcsBase::Tr::tr("Mercurial Annotation Editor"),
Constants::ANNOTATEAPP,
[this] { return new MercurialEditorWidget; },
std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2)
@@ -180,7 +181,7 @@ public:
VcsEditorFactory diffEditorFactory {{
DiffOutput,
Constants::DIFFLOG_ID,
- Constants::DIFFLOG_DISPLAY_NAME,
+ VcsBase::Tr::tr("Mercurial Diff Editor"),
Constants::DIFFAPP,
[this] { return new MercurialEditorWidget; },
std::bind(&MercurialPluginPrivate::vcsDescribe, this, _1, _2)
@@ -197,7 +198,7 @@ MercurialPluginPrivate::MercurialPluginPrivate()
setupVcsSubmitEditor(this, {
Constants::COMMITMIMETYPE,
Constants::COMMIT_ID,
- Constants::COMMIT_DISPLAY_NAME,
+ VcsBase::Tr::tr("Mercurial Commit Log Editor"),
VcsBaseSubmitEditorParameters::DiffFiles,
[] { return new CommitEditor; }
});