From 1da8f62783716217f9aaa1eb7ed8301914b112cc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 5 Oct 2023 14:51:21 +0200 Subject: [PATCH] HelloWorld: Cleanup Change-Id: I19abb60e9a6db3a99955924f52c0b920b7fbd7f6 Reviewed-by: hjk Reviewed-by: --- src/plugins/helloworld/helloworld.qbs | 3 ++- src/plugins/helloworld/helloworldplugin.cpp | 17 ++++------------- src/plugins/helloworld/helloworldplugin.h | 9 +++------ src/plugins/helloworld/helloworldwindow.h | 7 ++----- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/plugins/helloworld/helloworld.qbs b/src/plugins/helloworld/helloworld.qbs index 65fc74e3b3e..41f6571426e 100644 --- a/src/plugins/helloworld/helloworld.qbs +++ b/src/plugins/helloworld/helloworld.qbs @@ -4,13 +4,14 @@ QtcPlugin { name: "HelloWorld" Depends { name: "Core" } - Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } + Depends { name: "Qt"; submodules: ["widgets"] } files: [ "helloworldplugin.cpp", "helloworldplugin.h", "helloworldwindow.cpp", "helloworldwindow.h", + "helloworldtr.h" ] } diff --git a/src/plugins/helloworld/helloworldplugin.cpp b/src/plugins/helloworld/helloworldplugin.cpp index 5a7c22f2163..9269910ce55 100644 --- a/src/plugins/helloworld/helloworldplugin.cpp +++ b/src/plugins/helloworld/helloworldplugin.cpp @@ -16,8 +16,7 @@ #include #include -namespace HelloWorld { -namespace Internal { +namespace HelloWorld::Internal { /*! A mode with a push button based on BaseMode. */ @@ -53,17 +52,12 @@ HelloWorldPlugin::~HelloWorldPlugin() delete m_helloMode; } -/*! Initializes the plugin. Returns true on success. +/*! Initializes the plugin. Plugins want to register objects with the plugin manager here. - \a errorMessage can be used to pass an error message to the plugin system, - if there was any. */ -bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMessage) +void HelloWorldPlugin::initialize() { - Q_UNUSED(arguments) - Q_UNUSED(errorMessage) - // Create a unique context for our own view, that will be used for the // menu entry later. Core::Context context("HelloWorld.MainView"); @@ -94,8 +88,6 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMe // Add a mode with a push button based on BaseMode. m_helloMode = new HelloMode; - - return true; } /*! Notification that all extensions that this plugin depends on have been @@ -121,5 +113,4 @@ void HelloWorldPlugin::sayHelloWorld() nullptr, tr("Hello World!"), tr("Hello World! Beautiful day today, isn't it?")); } -} // namespace Internal -} // namespace HelloWorld +} // namespace HelloWorld::Internal diff --git a/src/plugins/helloworld/helloworldplugin.h b/src/plugins/helloworld/helloworldplugin.h index 4c37aed60c6..773308b2eb7 100644 --- a/src/plugins/helloworld/helloworldplugin.h +++ b/src/plugins/helloworld/helloworldplugin.h @@ -5,8 +5,7 @@ #include -namespace HelloWorld { -namespace Internal { +namespace HelloWorld::Internal { class HelloMode; @@ -20,8 +19,7 @@ public: HelloWorldPlugin(); ~HelloWorldPlugin() override; - bool initialize(const QStringList &arguments, QString *errorMessage) override; - + void initialize() override; void extensionsInitialized() override; private: @@ -30,5 +28,4 @@ private: HelloMode *m_helloMode = nullptr; }; -} // namespace Internal -} // namespace HelloWorld +} // namespace HelloWorld::Internal diff --git a/src/plugins/helloworld/helloworldwindow.h b/src/plugins/helloworld/helloworldwindow.h index 8afb694b71e..d9e57615a32 100644 --- a/src/plugins/helloworld/helloworldwindow.h +++ b/src/plugins/helloworld/helloworldwindow.h @@ -5,16 +5,13 @@ #include -namespace HelloWorld { -namespace Internal { +namespace HelloWorld::Internal { class HelloWorldWindow : public QWidget { Q_OBJECT - public: explicit HelloWorldWindow(QWidget *parent = nullptr); }; -} // namespace Internal -} // namespace HelloWorld +} // namespace HelloWorld::Internal