Logo Search packages:      
Sourcecode: packagesearch version File versions

void PackageSearchImpl::showPackageInformation ( const QString &  package  )  [protected, virtual, slot]

This let the views show all information available about the package.

This request all plugins to update their information widgets and gets their information text.
If package is empty, the views will be cleared.

Note:
Do not call this function directly, but call setSelectedPackage() instead.

Definition at line 675 of file packagesearchimpl.cpp.

References _informationPlugins, NPlugin::InformationPlugin::clearInformationWidget(), handleMaker(), NPlugin::InformationPlugin::informationText(), NPlugin::InformationPlugin::informationWidget(), NPlugin::InformationPlugin::offersInformationText(), and NPlugin::InformationPlugin::updateInformationWidget().

{
      // if the package to be shown is not selected, deselect it
      QListViewItem* pSelected = _pPackageView->selectedItem();
      
      if ( pSelected && package != pSelected->text(0))
            _pPackageView->clearSelection();
      _pDetailsView->clear();
      int packageID = handleMaker().getHandle(toString(package));
      for ( InformationPluginContainer::iterator it = _informationPlugins.begin();
            it != _informationPlugins.end(); ++it )
      {
            NPlugin::InformationPlugin* pPlugin = (*it);
            if (package.isEmpty())
            {
                  pPlugin->clearInformationWidget();
            }
            else
            {
                  if ( pPlugin->offersInformationText())
                  {
                        try 
                        {
                              _pDetailsView->setText(_pDetailsView->text() + pPlugin->informationText(packageID));
                        }
                        // simply ignore it if the package was not available for this plugin
                        catch (NPlugin::PackageNotFoundException& e) {}
                  }
                  if (_pInformationContainer->currentPage() == pPlugin->informationWidget())
                  // show the page only if it is currenly active
                        pPlugin->updateInformationWidget(packageID);
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index