forked from qt-creator/qt-creator
analyzer: remove unneeded AnalyzerPluginPrivate class
Change-Id: I2fac5e0e8c796d6009ba30da82a5a7a67672851d Reviewed-on: http://codereview.qt.nokia.com/1517 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -775,16 +775,16 @@ AnalyzerManager::~AnalyzerManager()
|
|||||||
|
|
||||||
void AnalyzerManager::extensionsInitialized()
|
void AnalyzerManager::extensionsInitialized()
|
||||||
{
|
{
|
||||||
if (d->m_tools.isEmpty())
|
if (m_instance->d->m_tools.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (IAnalyzerTool *tool, d->m_tools)
|
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
||||||
tool->extensionsInitialized();
|
tool->extensionsInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManager::shutdown()
|
void AnalyzerManager::shutdown()
|
||||||
{
|
{
|
||||||
d->saveToolSettings(d->m_currentTool, d->m_currentMode);
|
m_instance->d->saveToolSettings(m_instance->d->m_currentTool, m_instance->d->m_currentMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManager::addTool(IAnalyzerTool *tool, const StartModes &modes)
|
void AnalyzerManager::addTool(IAnalyzerTool *tool, const StartModes &modes)
|
||||||
|
|||||||
@@ -56,16 +56,18 @@ typedef QList<StartMode> StartModes;
|
|||||||
class IAnalyzerTool;
|
class IAnalyzerTool;
|
||||||
class AnalyzerManagerPrivate;
|
class AnalyzerManagerPrivate;
|
||||||
|
|
||||||
|
|
||||||
|
// FIXME: Merge with AnalyzerPlugin.
|
||||||
class ANALYZER_EXPORT AnalyzerManager : public QObject
|
class ANALYZER_EXPORT AnalyzerManager : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AnalyzerManager(QObject *parent = 0);
|
explicit AnalyzerManager(QObject *parent);
|
||||||
~AnalyzerManager();
|
~AnalyzerManager();
|
||||||
|
|
||||||
void extensionsInitialized();
|
static void extensionsInitialized();
|
||||||
void shutdown();
|
static void shutdown();
|
||||||
|
|
||||||
// Register a tool and initialize it.
|
// Register a tool and initialize it.
|
||||||
static void addTool(IAnalyzerTool *tool, const StartModes &mode);
|
static void addTool(IAnalyzerTool *tool, const StartModes &mode);
|
||||||
|
|||||||
@@ -56,25 +56,6 @@ using namespace Analyzer::Internal;
|
|||||||
|
|
||||||
static AnalyzerPlugin *m_instance = 0;
|
static AnalyzerPlugin *m_instance = 0;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// AnalyzerPluginPrivate
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class AnalyzerPlugin::AnalyzerPluginPrivate
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
AnalyzerPluginPrivate(AnalyzerPlugin *qq):
|
|
||||||
q(qq),
|
|
||||||
m_manager(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
AnalyzerPlugin *q;
|
|
||||||
AnalyzerManager *m_manager;
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// AnalyzerPlugin
|
// AnalyzerPlugin
|
||||||
@@ -82,14 +63,12 @@ public:
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
AnalyzerPlugin::AnalyzerPlugin()
|
AnalyzerPlugin::AnalyzerPlugin()
|
||||||
: d(new AnalyzerPluginPrivate(this))
|
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnalyzerPlugin::~AnalyzerPlugin()
|
AnalyzerPlugin::~AnalyzerPlugin()
|
||||||
{
|
{
|
||||||
delete d;
|
|
||||||
m_instance = 0;
|
m_instance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +77,7 @@ bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorStri
|
|||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(errorString)
|
Q_UNUSED(errorString)
|
||||||
|
|
||||||
d->m_manager = new AnalyzerManager(this);
|
(void) new AnalyzerManager(this);
|
||||||
|
|
||||||
// Task integration.
|
// Task integration.
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
@@ -111,12 +90,12 @@ bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorStri
|
|||||||
|
|
||||||
void AnalyzerPlugin::extensionsInitialized()
|
void AnalyzerPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
d->m_manager->extensionsInitialized();
|
AnalyzerManager::extensionsInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExtensionSystem::IPlugin::ShutdownFlag AnalyzerPlugin::aboutToShutdown()
|
ExtensionSystem::IPlugin::ShutdownFlag AnalyzerPlugin::aboutToShutdown()
|
||||||
{
|
{
|
||||||
d->m_manager->shutdown();
|
AnalyzerManager::shutdown();
|
||||||
return SynchronousShutdown;
|
return SynchronousShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,10 +54,6 @@ public:
|
|||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
|
|
||||||
ShutdownFlag aboutToShutdown();
|
ShutdownFlag aboutToShutdown();
|
||||||
|
|
||||||
private:
|
|
||||||
class AnalyzerPluginPrivate;
|
|
||||||
AnalyzerPluginPrivate *d;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user