Logo Search packages:      
Sourcecode: qstardict version File versions  Download package

void QStarDict::DictCore::reloadDicts (  ) 

Reload loaded dicts.

Definition at line 206 of file dictcore.cpp.

References QStarDict::DictPlugin::loadedDicts(), plugin(), and QStarDict::DictPlugin::setLoadedDicts().

{
    QList<Dictionary> loaded;
    for (QHash<QString, QPluginLoader*>::const_iterator i = m_plugins.begin(); i != m_plugins.end(); ++i)
    {
        DictPlugin *plugin = qobject_cast<DictPlugin*>((*i)->instance());
        plugin->setLoadedDicts(plugin->loadedDicts());
        QStringList loadedNames = plugin->loadedDicts();
        for (QStringList::const_iterator j = loadedNames.begin(); j != loadedNames.end(); ++j)
            loaded << Dictionary(i.key(), *j);
    }
    QList<Dictionary> oldLoaded = m_loadedDicts;
    m_loadedDicts.clear();
    for (QList<Dictionary>::iterator i = oldLoaded.begin(); i != oldLoaded.end(); ++i)
        if (loaded.contains(*i))
            m_loadedDicts << *i;
}


Generated by  Doxygen 1.6.0   Back to index