From 1d1eb9c3a219223d44a93d4cf71f4a6cd0af8cbb Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Jul 2023 08:29:37 +0200 Subject: [PATCH] Templates: Use C++17 compact namespaces in the plugin template Change-Id: If4c8540e4d1d9b42efcd1c039c28f85bd0fb98fd Reviewed-by: Eike Ziller Reviewed-by: Alessandro Portale --- .../templates/wizards/qtcreatorplugin/myplugin.cpp | 6 ++---- .../qtcreator/templates/wizards/qtcreatorplugin/myplugin.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp index 47ab9ebcc50..ae3082c357d 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp @@ -13,8 +13,7 @@ #include #include -namespace %{PluginName} { -namespace Internal { +namespace %{PluginName}::Internal { %{CN}::%{CN}() { @@ -75,5 +74,4 @@ void %{CN}::triggerAction() tr("This is an action from %{PluginName}.")); } -} // namespace Internal -} // namespace %{PluginName} +} // namespace %{PluginName}::Internal diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h index 3851fa7c657..6644f4685fd 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.h @@ -9,8 +9,7 @@ #include -namespace %{PluginName} { -namespace Internal { +namespace %{PluginName}::Internal { class %{CN} : public ExtensionSystem::IPlugin { @@ -29,8 +28,7 @@ private: void triggerAction(); }; -} // namespace Internal -} // namespace %{PluginName} +} // namespace %{PluginName}::Internal @if ! '%{Cpp:PragmaOnce}' #endif // %{GUARD}