directfb: Switch to the new style plugins
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>
Sat, 25 Feb 2012 11:12:09 +0000 (12:12 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 27 Feb 2012 23:17:17 +0000 (00:17 +0100)
The plugin might advertize more keys than supported at runtime. E.g.
the directfbegl key might not be available. I would like to have a
directfb.json.in and then generate the right file or if moc would
pre-process the file...

Change-Id: Ia8ad4e1367c06f5e35d02822d4f830ce1e9dc577
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/plugins/platforms/directfb/directfb.json [new file with mode: 0644]
src/plugins/platforms/directfb/directfb.pro
src/plugins/platforms/directfb/main.cpp

diff --git a/src/plugins/platforms/directfb/directfb.json b/src/plugins/platforms/directfb/directfb.json
new file mode 100644 (file)
index 0000000..5c74095
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "Keys": [ "directfb", "directfbegl" ]
+}
index 0585777..ae47ec3 100644 (file)
@@ -43,3 +43,5 @@ directfbegl: {
 CONFIG += qpa/genericunixfontdatabase
 target.path += $$[QT_INSTALL_PLUGINS]/platforms
 INSTALLS += target
+
+OTHER_FILES += directfb.json
index 048e9ed..26bdd71 100644 (file)
@@ -57,6 +57,8 @@ QT_BEGIN_NAMESPACE
 
 class QDirectFbIntegrationPlugin : public QPlatformIntegrationPlugin
 {
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "directfb.json")
 public:
     QStringList keys() const;
     QPlatformIntegration *create(const QString&, const QStringList&);
@@ -86,6 +88,6 @@ QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system,
     return integration;
 }
 
-Q_EXPORT_PLUGIN2(directfb, QDirectFbIntegrationPlugin)
-
 QT_END_NAMESPACE
+
+#include "main.moc"