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

void QStarDict::DictCore::setLoadedDicts ( const QList< Dictionary > &  loadedDicts  ) 

Sets a loaded dictionaries. The first item in pair is a plugin name, the second item in pair is a dictionary name. If dictionary cannot be loaded it will not be added to availableDicts list.

Definition at line 161 of file dictcore.cpp.

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

Referenced by loadSettings().

    QHash<QString, QStringList> dicts;
    for (QList<Dictionary>::const_iterator i = loadedDicts.begin(); i != loadedDicts.end(); ++i)
        dicts[i->plugin()] << i->name();
    for (QHash<QString, QStringList>::const_iterator i = dicts.begin(); i != dicts.end(); ++i)
        if (! m_plugins.contains(i.key()))
        DictPlugin *plugin = qobject_cast<DictPlugin*>(m_plugins[i.key()]->instance());
        dicts[i.key()] = plugin->loadedDicts();
    for (QList<Dictionary>::const_iterator i = loadedDicts.begin(); i != loadedDicts.end(); ++i)
        if (dicts.contains(i->plugin()) && dicts[i->plugin()].contains(i->name()))
            m_loadedDicts << *i;

Generated by  Doxygen 1.6.0   Back to index