summaryrefslogtreecommitdiff
path: root/src/webtab/webpluginfactory.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-08-17 10:46:06 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit6cad3c95b9d5a53b62f3e7b727edba81642b11a5 (patch)
tree38fbf7091e9944e003ae8492d2a562fe27244fb8 /src/webtab/webpluginfactory.cpp
parentBookmarkWidget: (diff)
downloadrekonq-6cad3c95b9d5a53b62f3e7b727edba81642b11a5.tar.xz
Get sure rekonq makes use of djvu plugin
Also, clean up mimetype detection, following kdewebkit. This fixes bug 304562 and has been imported from rekonq code
Diffstat (limited to 'src/webtab/webpluginfactory.cpp')
-rw-r--r--src/webtab/webpluginfactory.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/webtab/webpluginfactory.cpp b/src/webtab/webpluginfactory.cpp
index b62af1c8..2344663e 100644
--- a/src/webtab/webpluginfactory.cpp
+++ b/src/webtab/webpluginfactory.cpp
@@ -50,13 +50,26 @@ void WebPluginFactory::setLoadClickToFlash(bool load)
}
-QObject *WebPluginFactory::create(const QString &mimeType,
+QObject *WebPluginFactory::create(const QString &_mimeType,
const QUrl &url,
const QStringList &argumentNames,
const QStringList &argumentValues) const
{
+ QString mimeType(_mimeType.trimmed());
+ // If no mimetype is provided, follow kwebpluginfactory road to determine/guess it
+ if (mimeType.isEmpty())
+ {
+ extractGuessedMimeType(url, &mimeType);
+ }
+
kDebug() << "loading mimeType: " << mimeType;
+ // we'd like to use djvu plugin if possible. If not available, rekonq protocol handler
+ // will provide a part to load it. See BUG:304562 about
+ if (mimeType == QL1S("image/vnd.djvu") || mimeType == QL1S("image/x.djvu"))
+ return 0;
+
+
switch (ReKonfig::pluginsEnabled())
{
case 0: