forked from qt-creator/qt-creator
ClassView: Adapt to new plugin setup pattern
Change-Id: Ieb97736ceb462baf6d97dc39cc4bd08854477a92 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -27,31 +27,40 @@
|
|||||||
#include "classviewmanager.h"
|
#include "classviewmanager.h"
|
||||||
#include "classviewnavigationwidgetfactory.h"
|
#include "classviewnavigationwidgetfactory.h"
|
||||||
|
|
||||||
#include <QtPlugin>
|
|
||||||
|
|
||||||
namespace ClassView {
|
namespace ClassView {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
///////////////////////////////// Plugin //////////////////////////////////
|
///////////////////////////////// Plugin //////////////////////////////////
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Plugin
|
\class ClassViewPlugin
|
||||||
\brief The Plugin class is the base class for the Class View plugin.
|
\brief The ClassViewPlugin class implements the Class View plugin.
|
||||||
|
|
||||||
The Class View shows the namespace and class hierarchy of the currently open
|
The Class View shows the namespace and class hierarchy of the currently open
|
||||||
projects in the sidebar.
|
projects in the sidebar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool Plugin::initialize(const QStringList &arguments, QString *errorMessage)
|
class ClassViewPluginPrivate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NavigationWidgetFactory navigationWidgetFactory;
|
||||||
|
Manager manager;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ClassViewPluginPrivate *dd = nullptr;
|
||||||
|
|
||||||
|
ClassViewPlugin::~ClassViewPlugin()
|
||||||
|
{
|
||||||
|
delete dd;
|
||||||
|
dd = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ClassViewPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
|
|
||||||
// add to ExtensionSystem
|
dd = new ClassViewPluginPrivate;
|
||||||
addAutoReleasedObject(new NavigationWidgetFactory);
|
|
||||||
|
|
||||||
// create manager
|
|
||||||
(void) new Manager(this);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -30,20 +30,18 @@
|
|||||||
namespace ClassView {
|
namespace ClassView {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class Plugin : public ExtensionSystem::IPlugin
|
class ClassViewPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ClassView.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ClassView.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
ClassViewPlugin() = default;
|
||||||
Plugin() {}
|
~ClassViewPlugin() final;
|
||||||
|
|
||||||
//! \implements ExtensionSystem::IPlugin::initialize
|
private:
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage = 0);
|
bool initialize(const QStringList &arguments, QString *errorMessage = nullptr) final;
|
||||||
|
void extensionsInitialized() final {}
|
||||||
//! \implements ExtensionSystem::IPlugin::extensionsInitialized
|
|
||||||
void extensionsInitialized() {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user