Remove dependency from QFactoryInterface for the print plugin

Change-Id: Ia35890b72e7797ef655bf97b4a34af2908657c0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Lars Knoll 2012-05-27 05:25:47 +02:00 committed by Qt by Nokia
parent 7715a2d0a5
commit 02191b6e4b
3 changed files with 1 additions and 22 deletions

View File

@ -52,15 +52,9 @@ class QCocoaPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.QPlatformPrinterSupportFactoryInterface" FILE "cocoa.json")
public:
QStringList keys() const;
QPlatformPrinterSupport *create(const QString &);
};
QStringList QCocoaPrinterSupportPlugin::keys() const
{
return QStringList(QStringLiteral("cocoaprintersupport"));
}
QPlatformPrinterSupport *QCocoaPrinterSupportPlugin::create(const QString &key)
{
if (key.compare(key, QStringLiteral("cocoaprintersupport"), Qt::CaseInsensitive) != 0)

View File

@ -53,15 +53,9 @@ class QWindowsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.QPlatformPrinterSupportFactoryInterface" FILE "windows.json")
public:
QStringList keys() const;
QPlatformPrinterSupport *create(const QString &);
};
QStringList QWindowsPrinterSupportPlugin::keys() const
{
return QStringList(QStringLiteral("windowsprintsupport"));
}
QPlatformPrinterSupport *QWindowsPrinterSupportPlugin::create(const QString &key)
{
if (key.compare(key, QStringLiteral("windowsprintsupport"), Qt::CaseInsensitive) == 0)

View File

@ -61,24 +61,15 @@ QT_BEGIN_NAMESPACE
class QPlatformPrinterSupport;
struct QPlatformPrinterSupportFactoryInterface : public QFactoryInterface
{
virtual QPlatformPrinterSupport *create(const QString &key) = 0;
};
#define QPlatformPrinterSupportFactoryInterface_iid "org.qt-project.QPlatformPrinterSupportFactoryInterface"
Q_DECLARE_INTERFACE(QPlatformPrinterSupportFactoryInterface, QPlatformPrinterSupportFactoryInterface_iid)
class Q_PRINTSUPPORT_EXPORT QPlatformPrinterSupportPlugin : public QObject, public QPlatformPrinterSupportFactoryInterface
class Q_PRINTSUPPORT_EXPORT QPlatformPrinterSupportPlugin : public QObject
{
Q_OBJECT
Q_INTERFACES(QPlatformPrinterSupportFactoryInterface:QFactoryInterface)
public:
explicit QPlatformPrinterSupportPlugin(QObject *parent = 0);
~QPlatformPrinterSupportPlugin();
virtual QStringList keys() const = 0;
virtual QPlatformPrinterSupport *create(const QString &key) = 0;
static QPlatformPrinterSupport *get();