Commit 21790a7e authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Remove WidgetPluginManagerPrivate



Change-Id: Ibe3352dff9d620656ca4279d67e1e622a3e4dd41
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@nokia.com>
parent eda83c91
......@@ -29,7 +29,6 @@
**************************************************************************/
#include "widgetpluginmanager.h"
#include "widgetpluginpath.h"
#include <iwidgetplugin.h>
#include <QCoreApplication>
......@@ -52,21 +51,8 @@ namespace QmlDesigner {
namespace Internal {
// ---- PluginManager[Private]
class WidgetPluginManagerPrivate {
public:
typedef QList<WidgetPluginPath> PluginPathList;
PluginPathList m_paths;
};
WidgetPluginManager::WidgetPluginManager() :
d(new WidgetPluginManagerPrivate)
{
}
WidgetPluginManager::~WidgetPluginManager()
WidgetPluginManager::WidgetPluginManager()
{
delete d;
}
WidgetPluginManager::IWidgetPluginList WidgetPluginManager::instances()
......@@ -74,8 +60,8 @@ WidgetPluginManager::IWidgetPluginList WidgetPluginManager::instances()
if (debug)
qDebug() << '>' << Q_FUNC_INFO << QLibraryInfo::buildKey();
IWidgetPluginList rc;
const WidgetPluginManagerPrivate::PluginPathList::iterator end = d->m_paths.end();
for (WidgetPluginManagerPrivate::PluginPathList::iterator it = d->m_paths.begin(); it != end; ++it)
const PluginPathList::iterator end = m_paths.end();
for (PluginPathList::iterator it = m_paths.begin(); it != end; ++it)
it->getInstances(&rc);
if (debug)
qDebug() << '<' << Q_FUNC_INFO << rc.size();
......@@ -87,15 +73,15 @@ bool WidgetPluginManager::addPath(const QString &path)
const QDir dir(path);
if (!dir.exists())
return false;
d->m_paths.push_back(WidgetPluginPath(dir));
m_paths.push_back(WidgetPluginPath(dir));
return true;
}
QAbstractItemModel *WidgetPluginManager::createModel(QObject *parent)
{
QStandardItemModel *model = new QStandardItemModel(parent);
const WidgetPluginManagerPrivate::PluginPathList::iterator end = d->m_paths.end();
for (WidgetPluginManagerPrivate::PluginPathList::iterator it = d->m_paths.begin(); it != end; ++it)
const PluginPathList::iterator end = m_paths.end();
for (PluginPathList::iterator it = m_paths.begin(); it != end; ++it)
model->appendRow(it->createModelItem());
return model;
}
......
......@@ -34,6 +34,9 @@
#include <QObject>
#include <QList>
#include "widgetpluginpath.h"
QT_BEGIN_NAMESPACE
class QString;
class QAbstractItemModel;
......@@ -45,8 +48,6 @@ class IWidgetPlugin;
namespace Internal {
class WidgetPluginManagerPrivate;
// PluginManager: Loads the plugin libraries on demand "as lazy as
// possible", that is, directories are scanned and
// instances are created only when instances() is called.
......@@ -54,11 +55,11 @@ class WidgetPluginManagerPrivate;
class WidgetPluginManager
{
Q_DISABLE_COPY(WidgetPluginManager)
typedef QList<WidgetPluginPath> PluginPathList;
public:
typedef QList<IWidgetPlugin *> IWidgetPluginList;
WidgetPluginManager();
~WidgetPluginManager();
bool addPath(const QString &path);
......@@ -69,7 +70,7 @@ public:
QAbstractItemModel *createModel(QObject *parent = 0);
private:
WidgetPluginManagerPrivate *d;
PluginPathList m_paths;
};
} // namespace Internal
......
......@@ -173,7 +173,7 @@ void WidgetPluginPath::ensureLoaded()
}
}
void WidgetPluginPath::getInstances(WidgetPluginManager::IWidgetPluginList *list)
void WidgetPluginPath::getInstances(IWidgetPluginList *list)
{
ensureLoaded();
// Compile list of instances
......
......@@ -31,8 +31,6 @@
#ifndef WIDGETPLUGINPATH_H
#define WIDGETPLUGINPATH_H
#include "widgetpluginmanager.h"
#include <QObject>
#include <QWeakPointer>
#include <QList>
......@@ -74,11 +72,12 @@ struct WidgetPluginData {
// IPlugins.
class WidgetPluginPath {
typedef QList<IWidgetPlugin *> IWidgetPluginList;
public:
explicit WidgetPluginPath(const QDir &path);
void getInstances(WidgetPluginManager::IWidgetPluginList *list);
void getInstances(IWidgetPluginList *list);
QDir path() const { return m_path; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment