Remove usage of deprecated plugin loader functionality.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Mon, 14 May 2012 10:36:03 +0000 (12:36 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 15 May 2012 12:37:42 +0000 (14:37 +0200)
Use QFactoryLoader::instance(int) instead if deprecated
QFactoryLoader::instance(key).

Change-Id: I61d087e7e03d472f69427e53f5f194856eb5bffe
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/quick/scenegraph/qsgcontextplugin.cpp

index bd1c4ce..dd5ad49 100644 (file)
@@ -99,7 +99,9 @@ QSGAdaptionPluginData *contextFactory()
 
 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
         if (!device.isEmpty()) {
-            plugin->factory = qobject_cast<QSGContextFactoryInterface*>(loader()->instance(device));
+            const int index = loader()->indexOf(device);
+            if (index != -1)
+                plugin->factory = qobject_cast<QSGContextFactoryInterface*>(loader()->instance(index));
             plugin->deviceName = device;
 #ifndef QT_NO_DEBUG
             if (!plugin->factory) {