Remove QFactoryInterface from the input plugins

Change-Id: Ia4a9dc5b4ef276dca39681848e531b4c9e4f64e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Lars Knoll 2012-05-27 05:16:14 +02:00 committed by Qt by Nokia
parent cf9264bb6b
commit 7715a2d0a5
4 changed files with 2 additions and 23 deletions

View File

@ -70,7 +70,7 @@ QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key)
const QString platform = paramList.takeFirst().toLower(); const QString platform = paramList.takeFirst().toLower();
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
if (QPlatformInputContext *ret = qLoadPlugin1<QPlatformInputContext, QPlatformInputContextFactoryInterface>(loader(), platform, paramList)) if (QPlatformInputContext *ret = qLoadPlugin1<QPlatformInputContext, QPlatformInputContextPlugin>(loader(), platform, paramList))
return ret; return ret;
#endif #endif
return 0; return 0;

View File

@ -63,24 +63,15 @@ QT_BEGIN_NAMESPACE
class QPlatformInputContext; class QPlatformInputContext;
struct QPlatformInputContextFactoryInterface : public QFactoryInterface
{
virtual QPlatformInputContext *create(const QString &key, const QStringList &paramList) = 0;
};
#define QPlatformInputContextFactoryInterface_iid "org.qt-project.Qt.QPlatformInputContextFactoryInterface" #define QPlatformInputContextFactoryInterface_iid "org.qt-project.Qt.QPlatformInputContextFactoryInterface"
Q_DECLARE_INTERFACE(QPlatformInputContextFactoryInterface, QPlatformInputContextFactoryInterface_iid) class Q_PLATFORMSUPPORT_EXPORT QPlatformInputContextPlugin : public QObject
class Q_PLATFORMSUPPORT_EXPORT QPlatformInputContextPlugin : public QObject, public QPlatformInputContextFactoryInterface
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(QPlatformInputContextFactoryInterface:QFactoryInterface)
public: public:
explicit QPlatformInputContextPlugin(QObject *parent = 0); explicit QPlatformInputContextPlugin(QObject *parent = 0);
~QPlatformInputContextPlugin(); ~QPlatformInputContextPlugin();
virtual QStringList keys() const = 0;
virtual QPlatformInputContext *create(const QString &key, const QStringList &paramList) = 0; virtual QPlatformInputContext *create(const QString &key, const QStringList &paramList) = 0;
}; };

View File

@ -51,15 +51,9 @@ class QIbusPlatformInputContextPlugin : public QPlatformInputContextPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "ibus.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "ibus.json")
public: public:
QStringList keys() const;
QIBusPlatformInputContext *create(const QString&, const QStringList&); QIBusPlatformInputContext *create(const QString&, const QStringList&);
}; };
QStringList QIbusPlatformInputContextPlugin::keys() const
{
return QStringList(QStringLiteral("ibus"));
}
QIBusPlatformInputContext *QIbusPlatformInputContextPlugin::create(const QString& system, const QStringList& paramList) QIBusPlatformInputContext *QIbusPlatformInputContextPlugin::create(const QString& system, const QStringList& paramList)
{ {
Q_UNUSED(paramList); Q_UNUSED(paramList);

View File

@ -51,15 +51,9 @@ class QMaliitPlatformInputContextPlugin : public QPlatformInputContextPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "maliit.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "maliit.json")
public: public:
QStringList keys() const;
QPlatformInputContext *create(const QString&, const QStringList&); QPlatformInputContext *create(const QString&, const QStringList&);
}; };
QStringList QMaliitPlatformInputContextPlugin::keys() const
{
return QStringList(QStringLiteral("maliit"));
}
QPlatformInputContext *QMaliitPlatformInputContextPlugin::create(const QString& system, const QStringList& paramList) QPlatformInputContext *QMaliitPlatformInputContextPlugin::create(const QString& system, const QStringList& paramList)
{ {
Q_UNUSED(paramList); Q_UNUSED(paramList);