예제 #1
0
String getPluginMimeTypeFromExtension(const String& extension)
{
    const Vector<PluginInfo>& plugins = pluginCache.plugins();
    for (size_t i = 0; i < plugins.size(); ++i) {
        for (size_t j = 0; j < plugins[i].mimes.size(); ++j) {
            const MimeClassInfo& mime = plugins[i].mimes[j];
            const Vector<String>& extensions = mime.extensions;
            for (size_t k = 0; k < extensions.size(); ++k) {
                if (extension == extensions[k])
                    return mime.type;
            }
        }
    }
    return String();
}
예제 #2
0
String getPluginMimeTypeFromExtension(const String& extension)
{
    const Vector<PluginInfo*>& plugins = pluginCache.plugins();
    for (size_t i = 0; i < plugins.size(); ++i) {
        for (size_t j = 0; j < plugins[i]->mimes.size(); ++j) {
            MimeClassInfo* mime = plugins[i]->mimes[j];
            Vector<String> extensions;
            mime->suffixes.split(",", extensions);
            for (size_t k = 0; k < extensions.size(); ++k) {
                if (extension == extensions[k])
                    return mime->type;
            }
        }
    }
    return String();
}
예제 #3
0
void PluginData::initPlugins()
{
    const Vector<PluginInfo*>& plugins = pluginCache.plugins();
    for (size_t i = 0; i < plugins.size(); ++i)
        m_plugins.append(clone(plugins[i]));
}
예제 #4
0
void PluginData::refresh()
{
    pluginCache.reset(true);
    pluginCache.plugins();  // Force the plugins to be reloaded now.
}