Logo Search packages:      
Sourcecode: packagesearch version File versions

void NPlugin::PluginManager::saveSettings ( NXml::XmlData outData,
QDomElement  parent 
)

Save the settings from this plugin container into the given XML tree.

Currently the only information is the plugins which are disabled.

Parameters:
outData XML Document which owns parent
parent the parent where under to add the settings

Definition at line 252 of file pluginmanager.cpp.

References _loadedPlugins, _pluginSettings, _settingsVersion, NXml::XmlData::addAttribute(), and NXml::XmlData::addElement().

{
      // take a look at the pluginmanager.dtd file for the XML structure
      QDomElement pluginManager = outData.addElement(parent, "PluginManager");
      outData.addAttribute(pluginManager, _settingsVersion, "settingsVersion");
      
      QDomElement disabledPlugins = outData.addElement(pluginManager, "DisabledPlugins");
      QDomElement pluginSettings = outData.addElement(pluginManager, "PluginSettings");
      
      for (list<PluginData>::iterator it = _disabledPlugins.begin(); it != _disabledPlugins.end(); ++it)
      {
            QDomElement plugin = outData.addElement(disabledPlugins, "Plugin");
            {
                  outData.addAttribute(plugin, it->name(), "name");
                  outData.addAttribute(plugin, it->version(), "version");
                  outData.addAttribute(plugin, it->author(), "author");
                  outData.addAttribute(plugin, it->directory, "directory");
                  outData.addAttribute(plugin, false, "enabled");
            }
            // store the settings for the disabled plugins
            map<string, const QDomElement>::const_iterator jt = _pluginSettings.find(it->name());
            if ( jt != _pluginSettings.end() )
            {
                  pluginSettings.appendChild(jt->second);
            }
      }
      for (PluginToDataMap::iterator it = _loadedPlugins.begin(); 
            it != _loadedPlugins.end(); ++it)
      {
            it->first->saveSettings(outData, pluginSettings);
      }
}


Generated by  Doxygen 1.6.0   Back to index