Todo: Move TodoPlugin class definition to .cpp

Change-Id: I5b82b14bf86655f0dab9379effb4ff156900b610
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-11-15 16:17:55 +01:00
parent 9b429c7ebd
commit 34f374baec
4 changed files with 28 additions and 48 deletions

View File

@@ -18,7 +18,7 @@ add_qtc_plugin(Todo
todooutputpane.cpp todooutputpane.h
todooutputtreeview.cpp todooutputtreeview.h
todooutputtreeviewdelegate.cpp todooutputtreeviewdelegate.h
todoplugin.cpp todoplugin.h
todoplugin.cpp
todoplugin.qrc
todoprojectsettingswidget.cpp todoprojectsettingswidget.h
todotr.h

View File

@@ -46,7 +46,6 @@ QtcPlugin {
"todooutputtreeviewdelegate.cpp",
"todooutputtreeviewdelegate.h",
"todoplugin.cpp",
"todoplugin.h",
"todoplugin.qrc",
"todotr.h",
]

View File

@@ -2,8 +2,6 @@
// Copyright (C) 2016 Vasiliy Sorokin
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "todoplugin.h"
#include "optionsdialog.h"
#include "todooutputpane.h"
#include "todoitemsprovider.h"
@@ -14,11 +12,11 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <projectexplorer/projectpanelfactory.h>
#include <extensionsystem/iplugin.h>
#include <utils/link.h>
namespace Todo {
namespace Internal {
namespace Todo::Internal {
class TodoPluginPrivate : public QObject
{
@@ -87,20 +85,31 @@ void TodoPluginPrivate::createTodoOutputPane()
this, &TodoPluginPrivate::todoItemClicked);
}
TodoPlugin::TodoPlugin()
class TodoPlugin final : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Todo.json")
public:
TodoPlugin()
{
qRegisterMetaType<TodoItem>("TodoItem");
}
}
TodoPlugin::~TodoPlugin()
{
~TodoPlugin() final
{
delete d;
}
}
void TodoPlugin::initialize()
{
void initialize() final
{
d = new TodoPluginPrivate;
}
}
} // namespace Internal
} // namespace Todo
private:
TodoPluginPrivate *d = nullptr;
};
} // Todo::Internal
#include "todoplugin.moc"

View File

@@ -1,28 +0,0 @@
// Copyright (C) 2016 Dmitry Savchenko
// Copyright (C) 2016 Vasiliy Sorokin
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <extensionsystem/iplugin.h>
namespace Todo {
namespace Internal {
class TodoPlugin final : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Todo.json")
public:
TodoPlugin();
~TodoPlugin() final;
void initialize() final;
private:
class TodoPluginPrivate *d = nullptr;
};
} // namespace Internal
} // namespace Todo