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);
|
}, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setupClassViewManager(QObject *guard)
|
||||||
|
{
|
||||||
|
(void) new Manager(guard);
|
||||||
|
}
|
||||||
|
|
||||||
} // ClassView::Internal
|
} // ClassView::Internal
|
||||||
|
@@ -13,12 +13,13 @@ namespace ClassView::Internal {
|
|||||||
|
|
||||||
class ManagerPrivate;
|
class ManagerPrivate;
|
||||||
|
|
||||||
class Manager : public QObject
|
class Manager final : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Manager(QObject *parent = nullptr);
|
explicit Manager(QObject *parent);
|
||||||
~Manager() override;
|
~Manager() final;
|
||||||
|
|
||||||
static Manager *instance();
|
static Manager *instance();
|
||||||
|
|
||||||
bool canFetchMore(QStandardItem *item, bool skipRoot = false) const;
|
bool canFetchMore(QStandardItem *item, bool skipRoot = false) const;
|
||||||
@@ -42,4 +43,6 @@ private:
|
|||||||
ManagerPrivate *d;
|
ManagerPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void setupClassViewManager(QObject *guard);
|
||||||
|
|
||||||
} // ClassView::Internal
|
} // ClassView::Internal
|
||||||
|
@@ -19,24 +19,12 @@ namespace Internal {
|
|||||||
projects in the sidebar.
|
projects in the sidebar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ClassViewPluginPrivate
|
ClassViewPlugin::~ClassViewPlugin() = default;
|
||||||
{
|
|
||||||
public:
|
|
||||||
Manager manager;
|
|
||||||
};
|
|
||||||
|
|
||||||
static ClassViewPluginPrivate *dd = nullptr;
|
|
||||||
|
|
||||||
ClassViewPlugin::~ClassViewPlugin()
|
|
||||||
{
|
|
||||||
delete dd;
|
|
||||||
dd = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassViewPlugin::initialize()
|
void ClassViewPlugin::initialize()
|
||||||
{
|
{
|
||||||
setupClassViewNavigationWidgetFactory();
|
setupClassViewNavigationWidgetFactory();
|
||||||
dd = new ClassViewPluginPrivate;
|
setupClassViewManager(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user