int KDCOPServiceStarter::startServiceFor( const QString& serviceType, const QString& constraint, const QString& preferences, QString *error, QCString* dcopService, int /*flags*/ ) { KTrader::OfferList offers = KTrader::self()->query(serviceType, "Application", constraint, preferences); if ( offers.isEmpty() ) return -1; KService::Ptr ptr = offers.first(); kdDebug() << "KDCOPServiceStarter: starting " << ptr->desktopEntryPath() << endl; return kapp->startServiceByDesktopPath( ptr->desktopEntryPath(), QStringList(), error, dcopService ); }
void RemoteMenu::startWizard() { KURL url; KService::Ptr service = KService::serviceByDesktopName(WIZARD_SERVICE); if (service && service->isValid()) { url.setPath(locate("apps", service->desktopEntryPath())); new KRun(url, 0, true); // will delete itself } }
void PanelAddButtonMenu::slotExec(int id) { if(!entryMap_.contains(id)) return; KSycocaEntry *e = entryMap_[id]; if(e->isType(KST_KServiceGroup)) { KServiceGroup::Ptr g = static_cast< KServiceGroup * >(e); containerArea->addServiceMenuButton(g->relPath()); } else if(e->isType(KST_KService)) { KService::Ptr service = static_cast< KService * >(e); containerArea->addServiceButton(service->desktopEntryPath()); } }
void QuickLauncher::serviceStartedByStorageId(TQString /*starter*/, TQString storageId) { KService::Ptr service = KService::serviceByStorageId(storageId); if (service->icon() == TQString::null) { kdDebug() << storageId << " has no icon. Makes no sense to add it."; return; } QuickURL url = QuickURL(locate("apps", service->desktopEntryPath())); TQString desktopMenuId(url.menuId()); kdDebug() << "storageId=" << storageId << " desktopURL=" << desktopMenuId << endl; // A service was started somwhere else. If the quicklauncher contains // this service too, we flash the icon QuickButton *startedButton = 0; std::set<TQString> buttonIdSet; for (uint n = 0; n < m_buttons->size(); ++n) { QuickButton *button = (*m_buttons)[n]; TQString buttonMenuId = button->menuId(); buttonIdSet.insert(buttonMenuId); if (desktopMenuId == buttonMenuId) { kdDebug() << "QuickLauncher: I know that one: " << storageId << endl; button->flash(); startedButton = button; } } // Update popularity info. // We do this even if autoadjust is disabled // so there are sane values to start with if it's turned on. m_popularity->useService(desktopMenuId); if (m_settings->autoAdjustEnabled()) { TQTimer::singleShot(0, this, TQT_SLOT(slotAdjustToCurrentPopularity())); } }
void PluginManager::dump( const KService::Ptr service ) { #define ENDLI endl << Debug::indent() kdDebug() << ENDLI << "PluginManager Service Info:" << ENDLI << "---------------------------" << ENDLI << "name : " << service->name() << ENDLI << "library : " << service->library() << ENDLI << "desktopEntryPath : " << service->desktopEntryPath() << ENDLI << "X-KDE-amaroK-plugintype : " << service->property( "X-KDE-amaroK-plugintype" ).toString() << ENDLI << "X-KDE-amaroK-name : " << service->property( "X-KDE-amaroK-name" ).toString() << ENDLI << "X-KDE-amaroK-authors : " << service->property( "X-KDE-amaroK-authors" ).toStringList() << ENDLI << "X-KDE-amaroK-rank : " << service->property( "X-KDE-amaroK-rank" ).toString() << ENDLI << "X-KDE-amaroK-version : " << service->property( "X-KDE-amaroK-version" ).toString() << ENDLI << "X-KDE-amaroK-framework-version: " << service->property( "X-KDE-amaroK-framework-version" ).toString() << endl << endl; #undef ENDLI }
void RemotePlugin::loadActions(DOM::HTMLElement node) { KService::Ptr service = KService::serviceByDesktopName("knetattach"); if(service && service->isValid()){ DOM::DOMString innerHTML; MetabarWidget::addEntry(innerHTML, i18n("Add a Network Folder"), "desktop://" + locate("apps", service->desktopEntryPath()), "wizard"); node.setInnerHTML(innerHTML); m_functions->show("actions"); } else{ m_functions->hide("actions"); } }