forked from qt-creator/qt-creator
ClassView: Move setup of Manager class closer to new pattern
Change-Id: I2b836b839b1b082bdb6507082f689e2ef114eb9c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -404,4 +404,9 @@ void Manager::setFlatMode(bool flat)
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void setupClassViewManager(QObject *guard)
|
||||
{
|
||||
(void) new Manager(guard);
|
||||
}
|
||||
|
||||
} // ClassView::Internal
|
||||
|
@@ -13,12 +13,13 @@ namespace ClassView::Internal {
|
||||
|
||||
class ManagerPrivate;
|
||||
|
||||
class Manager : public QObject
|
||||
class Manager final : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Manager(QObject *parent = nullptr);
|
||||
~Manager() override;
|
||||
explicit Manager(QObject *parent);
|
||||
~Manager() final;
|
||||
|
||||
static Manager *instance();
|
||||
|
||||
bool canFetchMore(QStandardItem *item, bool skipRoot = false) const;
|
||||
@@ -42,4 +43,6 @@ private:
|
||||
ManagerPrivate *d;
|
||||
};
|
||||
|
||||
void setupClassViewManager(QObject *guard);
|
||||
|
||||
} // ClassView::Internal
|
||||
|
@@ -19,24 +19,12 @@ namespace Internal {
|
||||
projects in the sidebar.
|
||||
*/
|
||||
|
||||
class ClassViewPluginPrivate
|
||||
{
|
||||
public:
|
||||
Manager manager;
|
||||
};
|
||||
|
||||
static ClassViewPluginPrivate *dd = nullptr;
|
||||
|
||||
ClassViewPlugin::~ClassViewPlugin()
|
||||
{
|
||||
delete dd;
|
||||
dd = nullptr;
|
||||
}
|
||||
ClassViewPlugin::~ClassViewPlugin() = default;
|
||||
|
||||
void ClassViewPlugin::initialize()
|
||||
{
|
||||
setupClassViewNavigationWidgetFactory();
|
||||
dd = new ClassViewPluginPrivate;
|
||||
setupClassViewManager(this);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user