From 04da2debaea50b8339404280daba2290961203c6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 15 Oct 2009 00:45:10 +0200 Subject: Fixing code of PluginFactory + PreviewImage. In this way, we don't need to pass *ALL* the QStringList(s).. --- src/webpluginfactory.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/webpluginfactory.cpp') diff --git a/src/webpluginfactory.cpp b/src/webpluginfactory.cpp index 834cba95..b9d50697 100644 --- a/src/webpluginfactory.cpp +++ b/src/webpluginfactory.cpp @@ -53,14 +53,22 @@ QObject *WebPluginFactory::create(const QString &mimeType, const QStringList &argumentNames, const QStringList &argumentValues) const { - Q_UNUSED(argumentNames) - Q_UNUSED(argumentValues) - kDebug() << "loading mimeType: " << mimeType; if(mimeType == QString("application/image-preview") ) - { - return new PreviewImage(url, argumentNames, argumentValues); + { + int number = -1; + bool isFavorite = false; + + int i; + i = argumentNames.indexOf( QString("isFavorite") ); + if(i > -1) + isFavorite = true; + i = argumentNames.indexOf( QString("index") ); + if(i > -1) + number = argumentValues.at(i).toInt(); + + return new PreviewImage(url, number, isFavorite); } // this let QtWebKit using builtin plugins -- cgit v1.2.1