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

int KBearFileSysPart::setupOpenWithMenu (  )  [private]

Definition at line 1563 of file kbearfilesyspart.cpp.

References slotOpenWithService().

Referenced by slotSetupPopupMenu().

      static const QString& app_str = KGlobal::staticQString("Application");
      QPopupMenu* openMenu;
      openMenu = openWithMenu->popupMenu();
      m_serviceActionList.clear();  // remove and delete action from list
      //Now everything is cleared so lets see if we can find any services matching our selection
      QValueList<KServiceOffer> offers = KServiceTypeProfile::offers( m_fileView->currentFileItem()->mimetype(), app_str );
      QValueList<KServiceOffer>::Iterator iter;
      for( iter = offers.begin(); iter != offers.end(); ++iter) {
            // If we gets here there are matching services
            KService::Ptr servicePtr = (*iter).service();
            KAction* action = new KAction( servicePtr->name(), servicePtr->icon(),
                                          KShortcut(), this, servicePtr->exec());
            m_serviceActionList.append( action );
            action->plug( openMenu );
            connect( openMenu, SIGNAL(activated(int)), this, SLOT(slotOpenWithService( int ) ) );
      actionSeparator->plug( openMenu );
      m_privateActionCollection->action("open with")->setText( i18n("&Other...") );
      m_privateActionCollection->action("open with")->plug( openMenu );
      return offers.count();

Generated by  Doxygen 1.6.0   Back to index