Logo Search packages:      
Sourcecode: packagesearch version File versions

void PackageSearchImpl::addPlugin ( NPlugin::Plugin pPlugin  )  [virtual]

This method is called by the PluginManager whenever a new plugin is loaded.

Implements NPlugin::IPluginUser.

Definition at line 209 of file packagesearchimpl.cpp.

References _informationPlugins, _plugins, _searchPlugins, _shortInformationPlugins, onSearchChanged(), updateInformationPluginGui(), updateSearchPluginGui(), and updateShortInformationPluginGui().

Referenced by addPlugin(), and initialize().

{
      using namespace NPlugin;
      _plugins.push_back(pPlugin);

      SearchPlugin* pSearchPlugin = dynamic_cast<SearchPlugin*>(pPlugin);
      if (pSearchPlugin != 0)
      {
            _searchPlugins.push_back(pSearchPlugin);
            sort(_searchPlugins.begin(), _searchPlugins.end(), LesserPriority<SearchPlugin>());
            updateSearchPluginGui();
            connect(pSearchPlugin, SIGNAL(searchChanged(NPlugin::SearchPlugin*)), 
                  SLOT(onSearchChanged(NPlugin::SearchPlugin*)));
            /// @todo connect selectionChanged signal
      }
      InformationPlugin* pInformationPlugin = dynamic_cast<InformationPlugin*>(pPlugin);
      if (pInformationPlugin != 0)
      {
            _informationPlugins.push_back(pInformationPlugin);
            sort(_informationPlugins.begin(), _informationPlugins.end(), 
                  LesserPriority<InformationPlugin>());
            updateInformationPluginGui();
      }
      ShortInformationPlugin* pShortInformationPlugin = dynamic_cast<ShortInformationPlugin*>(pPlugin);
      if (pShortInformationPlugin != 0)
      {
            _shortInformationPlugins.push_back(pShortInformationPlugin);
            sort(_shortInformationPlugins.begin(), _shortInformationPlugins.end(),
                  LesserPriority<ShortInformationPlugin>());
            updateShortInformationPluginGui();
      }
}


Generated by  Doxygen 1.6.0   Back to index