diff options
| author | Leon Clarke <leonclarke@google.com> | 2010-06-03 14:33:32 +0100 |
|---|---|---|
| committer | Leon Clarke <leonclarke@google.com> | 2010-06-08 12:24:51 +0100 |
| commit | 5af96e2c7b73ebc627c6894727826a7576d31758 (patch) | |
| tree | f9d5e6f6175ccd7e3d14de9b290f08937a0d17ba /WebCore/plugins/qt/PluginDataQt.cpp | |
| parent | 8cc4fcf4f6adcbc0e0aebfc24fbad9a4cddf2cfb (diff) | |
| download | external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.zip external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.gz external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.bz2 | |
Merge webkit.org at r60469 : Initial merge by git.
Change-Id: I66a0047aa2af802f66bb0c7f2a8b02247a596234
Diffstat (limited to 'WebCore/plugins/qt/PluginDataQt.cpp')
| -rw-r--r-- | WebCore/plugins/qt/PluginDataQt.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/WebCore/plugins/qt/PluginDataQt.cpp b/WebCore/plugins/qt/PluginDataQt.cpp index 188365a..8d4968b 100644 --- a/WebCore/plugins/qt/PluginDataQt.cpp +++ b/WebCore/plugins/qt/PluginDataQt.cpp @@ -42,19 +42,20 @@ void PluginData::initPlugins() for (int i = 0; i < qplugins.count(); ++i) { const QWebPluginFactory::Plugin& qplugin = qplugins.at(i); - PluginInfo* info = new PluginInfo; - info->name = qplugin.name; - info->desc = qplugin.description; + PluginInfo info; + info.name = qplugin.name; + info.desc = qplugin.description; for (int j = 0; j < qplugin.mimeTypes.count(); ++j) { const QWebPluginFactory::MimeType& mimeType = qplugin.mimeTypes.at(j); - MimeClassInfo* mimeInfo = new MimeClassInfo; - mimeInfo->type = mimeType.name; - mimeInfo->desc = mimeType.description; - mimeInfo->suffixes = mimeType.fileExtensions.join(QLatin1String("; ")); + MimeClassInfo mimeInfo; + mimeInfo.type = mimeType.name; + mimeInfo.desc = mimeType.description; + mimeInfo.suffixes = mimeType.fileExtensions.join(QLatin1String("; ")); + mimeInfo.pluginIndex = m_plugins.size(); - info->mimes.append(mimeInfo); + info.mimes.append(mimeInfo); } m_plugins.append(info); @@ -65,31 +66,32 @@ void PluginData::initPlugins() const Vector<PluginPackage*> &plugins = db->plugins(); for (unsigned int i = 0; i < plugins.size(); ++i) { - PluginInfo* info = new PluginInfo; + PluginInfo info; PluginPackage* package = plugins[i]; - info->name = package->name(); - info->file = package->fileName(); - info->desc = package->description(); + info.name = package->name(); + info.file = package->fileName(); + info.desc = package->description(); const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions(); MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end(); for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) { - MimeClassInfo* mime = new MimeClassInfo; - info->mimes.append(mime); + MimeClassInfo mime; - mime->type = it->first; - mime->desc = it->second; - mime->plugin = info; + mime.type = it->first; + mime.desc = it->second; + mime.pluginIndex = m_plugins.size(); - Vector<String> extensions = package->mimeToExtensions().get(mime->type); + Vector<String> extensions = package->mimeToExtensions().get(mime.type); for (unsigned i = 0; i < extensions.size(); i++) { if (i > 0) - mime->suffixes += ","; + mime.suffixes += ","; - mime->suffixes += extensions[i]; + mime.suffixes += extensions[i]; } + + info.mimes.append(mime); } m_plugins.append(info); |
