PlugInInfoStoreQt.cpp [plain text]
#include "PluginInfoStore.h"
#include "qdebug.h"
#if QT_VERSION < 0x040400
#include "qwebobjectplugin_p.h"
#endif
#include "NotImplemented.h"
namespace WebCore {
PluginInfo* PluginInfoStore::createPluginInfoForPluginAtIndex(unsigned i)
{
#if QT_VERSION < 0x040400
QWebFactoryLoader *loader = QWebFactoryLoader::self();
if (i > loader->m_pluginInfo.count())
return 0;
const QWebFactoryLoader::Info &qinfo = loader->m_pluginInfo.at(i);
PluginInfo *info = new PluginInfo;
info->name = qinfo.name;
info->desc = qinfo.description;
foreach (const QWebFactoryLoader::MimeInfo &m, qinfo.mimes) {
MimeClassInfo *mime = new MimeClassInfo;
mime->type = m.type;
mime->plugin = info;
foreach (QString ext, m.extensions)
mime->suffixes.append(ext);
info->mimes.append(mime);
}
return info;
#else
return 0; #endif
}
unsigned PluginInfoStore::pluginCount() const
{
#if QT_VERSION < 0x040400
return QWebFactoryLoader::self()->keys().count();
#else
return 0;
#endif
}
String PluginInfoStore::pluginNameForMIMEType(const String& mimeType)
{
return String();
}
bool PluginInfoStore::supportsMIMEType(const WebCore::String& string)
{
#if QT_VERSION < 0x040400
bool supports = QWebFactoryLoader::self()->supportsMimeType(string);
#else
bool supports = false;
#endif
return supports;
}
void refreshPlugins(bool) {
notImplemented();
}
}