• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ktrader::OfferList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ktrader::OfferList的典型用法代码示例。如果您正苦于以下问题:C++ OfferList类的具体用法?C++ OfferList怎么用?C++ OfferList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了OfferList类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: KaffeineDVBsection

DVBevents::DVBevents( QString devType, int anum, int tnum, const QString &charset, EventTable *table )
	: KaffeineDVBsection( anum, tnum, charset )
{
	events = table;
	KaffeineEpgPlugin *plug;
	QString plugName;
	int error;

	KTrader::OfferList offers = KTrader::self()->query("KaffeineEpgPlugin");
	KTrader::OfferList::Iterator end( offers.end() );
	for ( KTrader::OfferList::Iterator it=offers.begin(); it!=end; ++it ) {
		error = 0;
		KService::Ptr ptr = (*it);
		if ( !ptr->name().contains(devType) )
			continue;
		plug = KParts::ComponentFactory::createPartInstanceFromService<KaffeineEpgPlugin>(ptr, 0, ptr->name().ascii(), 0, 0, 0, &error );
		plugName = ptr->desktopEntryName();
		if (error > 0) {
			fprintf( stderr, "Loading of EPG plugin %s failed: %s\n", plugName.ascii(), KLibLoader::self()->lastErrorMessage().ascii() );
			plug = NULL;
		}
		else {
			plugs.append( plug );
			plug->setTable( table );
			plug->initSection( anum, tnum, charset );
			plugNames.append( plugName );
		}
	}
	fprintf( stderr, "%d EPG plugins loaded for device %d:%d.\n", plugs.count(), anum, tnum );
}
开发者ID:iegor,项目名称:kdesktop,代码行数:30,代码来源:dvbevents.cpp


示例2: QWidget

ksimoptsView::ksimoptsView(QWidget *parent)
    : QWidget(parent),
      DCOPObject("ksimoptsIface")
{
    // setup our layout manager to automatically add our widgets
    QHBoxLayout *top_layout = new QHBoxLayout(this);
    top_layout->setAutoAdd(true);

    // we want to look for all components that satisfy our needs.  the
    // trader will actually search through *all* registered KDE
    // applications and components -- not just KParts.  So we have to
    // specify two things: a service type and a constraint
    //
    // the service type is like a mime type.  we say that we want all
    // applications and components that can handle HTML -- 'text/html'
    //
    // however, by itself, this will return such things as Netscape..
    // not what we wanted.  so we constrain it by saying that the
    // string 'KParts/ReadOnlyPart' must be found in the ServiceTypes
    // field.  with this, only components of the type we want will be
    // returned.
    KTrader::OfferList offers = KTrader::self()->query("text/html", "'KParts/ReadWritePart' in ServiceTypes");

    KLibFactory *factory = 0;
    // in theory, we only care about the first one.. but let's try all
    // offers just in case the first can't be loaded for some reason
    KTrader::OfferList::Iterator it(offers.begin());
    for( ; it != offers.end(); ++it)
    {
        KService::Ptr ptr = (*it);

        // we now know that our offer can handle HTML and is a part.
        // since it is a part, it must also have a library... let's try to
        // load that now
        factory = KLibLoader::self()->factory( ptr->library() );
        if (factory)
        {
            m_html = static_cast<KParts::ReadWritePart *>(factory->create(this, ptr->name(), "KParts::ReadWritePart"));
            break;
        }
    }

    // if our factory is invalid, then we never found our component
    // and we might as well just exit now
    if (!factory)
    {
        KMessageBox::error(this, i18n("Could not find a suitable HTML component"));
        return;
    }

    connect(m_html, SIGNAL(setWindowCaption(const QString&)),
            this,   SLOT(slotSetTitle(const QString&)));
    connect(m_html, SIGNAL(setStatusBarText(const QString&)),
            this,   SLOT(slotOnURL(const QString&)));

}
开发者ID:BackupTheBerlios,项目名称:ksimopts-svn,代码行数:56,代码来源:ksimoptsview.cpp


示例3: displayPluginList

void ImportWizard::displayPluginList()
{
  KTrader::OfferList plugins = KFTPAPI::getInstance()->pluginManager()->getImportPlugins();

  KTrader::OfferList::ConstIterator end(plugins.end());
  for (KTrader::OfferList::ConstIterator i(plugins.begin()); i != end; ++i) {
    KService::Ptr service = *i;

    new PluginListItem(m_pluginList, service);
  }
}
开发者ID:netrunner-debian-kde-extras,项目名称:kftpgrabber,代码行数:11,代码来源:importwizard.cpp


示例4: Plugin

KHTMLPluginKTTSD::KHTMLPluginKTTSD(QObject *parent, const char *name, const QStringList &) : Plugin(parent, name)
{
    // If KTTSD is not installed, hide action.
    KTrader::OfferList offers = KTrader::self()->query("DCOP/Text-to-Speech", "Name == 'KTTSD'");
    if(offers.count() > 0)
    {
        (void)new KAction(i18n("&Speak Text"), "kttsd", 0, this, SLOT(slotReadOut()), actionCollection(), "tools_kttsd");
    }
    else
        kdDebug() << "KHTMLPLuginKTTSD::KHTMLPluginKTTSD: KTrader did not find KTTSD." << endl;
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:11,代码来源:khtmlkttsd.cpp


示例5: init

void PluginSelectDialog::init( )
{
	const QValueList<KDevPlugin*> loadedPlugins = PluginController::getInstance()->loadedPlugins();
	QStringList loadedPluginDesktopNames;
	QValueList<KDevPlugin*>::ConstIterator it = loadedPlugins.begin();
	while( it != loadedPlugins.end() )
	{
		loadedPluginDesktopNames << (*it)->instance()->instanceName();
		++it;
	}

	kdDebug(9000) << " *** loadedPluginDesktopNames: " << loadedPluginDesktopNames << endl;

	KTrader::OfferList localOffers;
	if ( ProjectManager::getInstance()->projectLoaded() )
	{
		localOffers = PluginController::getInstance()->engine().offers(
			PluginController::getInstance()->currentProfile(), ProfileEngine::Project );
	}

	KTrader::OfferList globalOffers = PluginController::getInstance()->engine().offers(
		PluginController::getInstance()->currentProfile(), ProfileEngine::Global);

	KTrader::OfferList offers = localOffers + globalOffers;
	for (KTrader::OfferList::ConstIterator it = offers.begin(); it != offers.end(); ++it)
	{
		// parse out any existing url to make it clickable
		QString Comment = (*it)->comment();
		QRegExp re("\\bhttp://[\\S]*");
		re.search( Comment );
		Comment.replace( re, "" );

		QString url;
		if ( re.pos() > -1 )
		{
			url = re.cap();
		}

		PluginItem *item = new PluginItem( plugin_list, (*it)->desktopEntryName(), (*it)->genericName(), Comment, url );
		item->setOn( loadedPluginDesktopNames.contains( (*it)->desktopEntryName() ) );

		kdDebug(9000) << (*it)->desktopEntryName() << " : " << (loadedPluginDesktopNames.contains( (*it)->desktopEntryName() ) ? "YES" : "NO" ) << endl;
	}

	QListViewItem * first = plugin_list->firstChild();
	if ( first )
	{
		plugin_list->setSelected( first, true );
	}
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:50,代码来源:pluginselectdialog.cpp


示例6: openURL

bool KPartSaver::openURL( KURL url )
{
    closeURL();

    // find mime type
    TQString mime = KMimeType::findByURL( url )->name();

    // find fitting kparts
    KTrader::OfferList offers;
    offers = KTrader::self()->query( mime, "'KParts/ReadOnlyPart' in ServiceTypes" );
    if( offers.count()==0 ) {
        kdDebug() << "Can't find proper kpart for " << mime << endl;
        return false;
    }

    // load kpart library
    TQString lib = offers.first()->library();
    KLibFactory *factory = KLibLoader::self()->factory( lib.latin1() );
    if( !factory ) {
        kdDebug() << "Library " << lib << " not found." << endl;
        return false;
    }

    // create kpart
    m_part = (KParts::ReadOnlyPart *)factory->create( TQT_TQOBJECT(this), "kpart", "KParts::ReadOnlyPart" );
    if( !m_part ) {
        kdDebug() << "Part for " << url.url() << " can't be constructed" << endl;
        return false;
    } else
        embed( m_part->widget() );

    // show kpart
    delete m_back;
    m_back = 0;

    show();
    m_part->widget()->show();

    // load url
    if( !m_part->openURL( url ) ) {
        kdDebug() << "Can't load " << url.url() << endl;
        closeURL();
        return false;
    }



    return true;
}
开发者ID:Fat-Zer,项目名称:kdeartwork,代码行数:49,代码来源:kpartsaver.cpp


示例7: insertOpenWithMenu

void BaseTreeView::insertOpenWithMenu(KPopupMenu *menu, int position)
{
  if (m_openWithMenuId != -1)
    menu->removeItem(m_openWithMenuId);
  for (uint i = 0; i < m_openWithActions.count(); i++)
  {
    KAction *action = m_openWithActions[i];
    delete action;
  }
  m_openWithActions.clear();
  KURL urlToOpen = currentURL();
  QString mimeType = KMimeType::findByURL(urlToOpen, 0, true, true)->name();
  KTrader::OfferList offers = KTrader::self()->query(mimeType, "Type == 'Application'");
  QDict<QuantaPlugin> plugins = QuantaPluginInterface::ref()->plugins();   
  m_pluginIds.clear();

  if (offers.count() > 0 || plugins.count() > 0)
  {
    m_openWithMenu = new KPopupMenu(this);
    if (offers.count() > 0) 
    {
      KTrader::OfferList::Iterator it;
      for (it = offers.begin(); it != offers.end(); ++it)
      {
        KAction *action = new KAction((*it)->name(), (*it)->icon(), 0, 0, QFile::encodeName((*it)->desktopEntryPath()).data());
        connect(action, SIGNAL(activated()), this, SLOT(slotOpenWithApplication()));
        action->plug(m_openWithMenu);
        m_openWithActions.append(action);
      }
      m_openWithMenu->insertSeparator();
    }
    if (plugins.count() > 0)
    {
      m_openWithMenu->insertTitle(i18n("Plugins"));
      QDictIterator<QuantaPlugin> it2(plugins);
      for(;it2.current();++it2)
      {
        int id = m_openWithMenu->insertItem(KGlobal::iconLoader()->loadIconSet(it2.current()->icon(),KIcon::Small), it2.current()->name());
        m_pluginIds[id] = it2.current();
      }
      connect(m_openWithMenu, SIGNAL(activated(int)), SLOT(slotOpenWithActivated(int)));    
      m_openWithMenu->insertSeparator();
    }
    m_openWithMenu->insertItem(i18n("&Other..."), this, SLOT(slotOpenWith()));
    m_openWithMenuId = menu->insertItem(i18n("Open &With"), m_openWithMenu, -1, position);
  } else
    m_openWithMenuId = menu->insertItem(i18n("Open &With..."), this, SLOT(slotOpenWith()), 0, -1, position);
}
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:48,代码来源:basetreeview.cpp


示例8: searchExtParts

void KDiffTextEdit::searchExtParts()
{
  // only execute once
  static bool init = false;
  if ( init )
    return;
  init = true;

  // search all parts that can handle text/x-diff
  KTrader::OfferList offers = KTrader::self()->query("text/x-diff", "('KParts/ReadOnlyPart' in ServiceTypes) and ('text/x-diff' in ServiceTypes) and (DesktopEntryName != 'katepart')");
  KTrader::OfferList::const_iterator it;
  for ( it = offers.begin(); it != offers.end(); ++it ) {
    KService::Ptr ptr = (*it);
    extPartsTranslated << ptr->name();
    extParts << ptr->desktopEntryName();
  }
  return;
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:18,代码来源:diffwidget.cpp


示例9: loadPlugins

void XXPortManager::loadPlugins()
{
    mXXPortObjects.clear();

    const KTrader::OfferList plugins = KTrader::self()->query("KAddressBook/XXPort",
                                       QString("[X-KDE-KAddressBook-XXPortPluginVersion] == %1").arg(KAB_XXPORT_PLUGIN_VERSION));
    KTrader::OfferList::ConstIterator it;
    for(it = plugins.begin(); it != plugins.end(); ++it)
    {
        if(!(*it)->hasServiceType("KAddressBook/XXPort"))
            continue;

        KLibFactory *factory = KLibLoader::self()->factory((*it)->library().latin1());
        if(!factory)
        {
            kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl;
            continue;
        }

        KAB::XXPortFactory *xxportFactory = static_cast<KAB::XXPortFactory *>(factory);

        if(!xxportFactory)
        {
            kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl;
            continue;
        }

        KAB::XXPort *obj = xxportFactory->xxportObject(mCore->addressBook(), mCore->widget());
        if(obj)
        {
            if(mCore->guiClient())
                mCore->guiClient()->insertChildClient(obj);

            mXXPortObjects.insert(obj->identifier(), obj);
            connect(obj, SIGNAL(exportActivated(const QString &, const QString &)),
                    this, SLOT(slotExport(const QString &, const QString &)));
            connect(obj, SIGNAL(importActivated(const QString &, const QString &)),
                    this, SLOT(slotImport(const QString &, const QString &)));

            obj->setKApplication(kapp);
        }
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:43,代码来源:xxportmanager.cpp


示例10:

void
EditorSelection::readConfig()
{
    m_editorsCombo->clear();

    KTrader::OfferList editors = KTrader::self()->query(
                                     QString::fromLatin1("Komposer/Editor"));
    KTrader::OfferList::ConstIterator it;
    int i = 0;
    for(it = editors.begin(); it != editors.end(); ++it, ++i)
    {
        if(!(*it)->hasServiceType(QString::fromLatin1("Komposer/Editor")))
            continue;

        QString name = (*it)->property("X-KDE-KomposerIdentifier").toString();
        m_editorsCombo->insertItem(name);
        if(m_reference.contains(name))
            m_editorsCombo->setCurrentItem(i);
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:20,代码来源:prefsmodule.cpp


示例11: block

Plugin*
PluginManager::createFromQuery( const QString &constraint )
{
    Debug::Block block( __PRETTY_FUNCTION__ );

    KTrader::OfferList offers = query( constraint );

    if ( offers.isEmpty() ) {
        warning() << k_funcinfo << "No matching plugin found.\n";
        return 0;
    }

    // Select plugin with highest rank
    int rank = 0;
    uint current = 0;
    for ( uint i = 0; i < offers.count(); i++ ) {
        if ( offers[i]->property( "X-KDE-amaroK-rank" ).toInt() > rank )
            current = i;
    }

    return createFromService( offers[current] );
}
开发者ID:tmarques,项目名称:waheela,代码行数:22,代码来源:pluginmanager.cpp


示例12: QWidget

EditorChooser::EditorChooser(QWidget *parent, const char *name) : QWidget(parent, name)
{
    d = new PrivateEditorChooser();

    // sizemanagment
    QGridLayout *grid = new QGridLayout(this, 1, 1);


    d->chooser = new EditorChooser_UI(this, name);

    grid->addWidget(d->chooser, 0, 0);


    KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
    KConfig *config = new KConfig("default_components");
    config->setGroup("KTextEditor");
    QString editor = config->readPathEntry("embeddedEditor");

    if(editor.isEmpty())
        editor = "katepart";

    for(KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it)
    {
        if((*it)->desktopEntryName().contains(editor))
        {
            d->chooser->editorCombo->insertItem(i18n("System Default (%1)").arg((*it)->name()));
            break;
        }
    }

    for(KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it)
    {
        d->chooser->editorCombo->insertItem((*it)->name());
        d->elements.append((*it)->desktopEntryName());
    }
    d->chooser->editorCombo->setCurrentItem(0);
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:37,代码来源:editorchooser.cpp


示例13: reload

void ContactEditorWidgetManager::reload()
{
    mFactories.clear();
    kdDebug(5720) << "ContactEditorWidgetManager::reload()" << endl;
    const KTrader::OfferList plugins = KTrader::self()->query("KAddressBook/ContactEditorWidget",
                                       QString("[X-KDE-KAddressBook-CEWPluginVersion] == %1").arg(KAB_CEW_PLUGIN_VERSION));

    KTrader::OfferList::ConstIterator it;
    for(it = plugins.begin(); it != plugins.end(); ++it)
    {
        KLibFactory *factory = KLibLoader::self()->factory((*it)->library().latin1());
        if(!factory)
        {
            kdDebug(5720) << "ContactEditorWidgetManager::reload(): Factory creation failed" << endl;
            continue;
        }

        KAB::ContactEditorWidgetFactory *pageFactory =
            static_cast<KAB::ContactEditorWidgetFactory *>(factory);

        if(!pageFactory)
        {
            kdDebug(5720) << "ContactEditorWidgetManager::reload(): Cast failed" << endl;
            continue;
        }

        mFactories.append(pageFactory);
    }

    // add all non-plugin contact editor factories
    mFactories.append(new FreeBusyWidgetFactory);
    mFactories.append(new ImageWidgetFactory);
    mFactories.append(new SoundWidgetFactory);
    mFactories.append(new GeoWidgetFactory);
    mFactories.append(new CustomFieldsWidgetFactory);
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:36,代码来源:contacteditorwidgetmanager.cpp


示例14: insertOpenWithItems

int DolphinContextMenu::insertOpenWithItems(KPopupMenu* popup,
                                            QValueVector<KService::Ptr>& openWithVector)
{
    // Prepare 'Open With' sub menu. Usually a sub menu is created, where all applications
    // are listed which are registered to open the item. As last entry "Other..." will be
    // attached which allows to select a custom application. If no applications are registered
    // no sub menu is created at all, only "Open With..." will be offered.
    const KFileItemList* list = m_dolphinView->selectedItems();
    assert(list != 0);

    bool insertOpenWithItems = true;
    const QString contextMimeType(m_fileInfo->mimetype());
    KFileItemListIterator mimeIt(*list);
    KFileItem* item = 0;
    while (insertOpenWithItems && ((item = mimeIt.current()) != 0)) {
        insertOpenWithItems = (contextMimeType == item->mimetype());
        ++mimeIt;
    }

    int openWithID = -1;

    if (insertOpenWithItems) {
        // fill the 'Open with' sub menu with application types
        const KMimeType::Ptr mimePtr = KMimeType::findByURL(m_fileInfo->url());
        KTrader::OfferList offers = KTrader::self()->query(mimePtr->name(),
                                                           "Type == 'Application'");
        int index = openWithIDStart;
        if (offers.count() > 0) {
            KTrader::OfferList::Iterator it;
            KPopupMenu* openWithMenu = new KPopupMenu();
            for(it = offers.begin(); it != offers.end(); ++it) {
                // The offer list from the KTrader returns duplicate
                // application entries. Although this seems to be a configuration
                // problem outside the scope of Dolphin, duplicated entries just
                // will be skipped here.
                const QString appName((*it)->name());
                if (!containsEntry(openWithMenu, appName)) {
                    openWithMenu->insertItem((*it)->pixmap(KIcon::Small),
                                            appName, index);
                    openWithVector.append(*it);
                    ++index;
                }
            }

            openWithMenu->insertSeparator();
            openWithMenu->insertItem(i18n("&Other..."), index);
            popup->insertItem(i18n("Open With"), openWithMenu);
        }
        else {
            // No applications are registered, hence just offer
            // a "Open With..." item instead of a sub menu containing
            // only one entry.
            popup->insertItem(i18n("Open With..."), openWithIDStart);
        }
        openWithID = index;
    }
    else {
        // At least one of the selected items has a different MIME type. In this case
        // just show a disabled "Open With..." entry.
        popup->insertItem(i18n("Open With..."), openWithIDStart);
        popup->setItemEnabled(openWithIDStart, false);
    }

    popup->setItemEnabled(openWithID, insertOpenWithItems);

    return openWithID;
}
开发者ID:serghei,项目名称:kde3-apps-dolphin,代码行数:67,代码来源:dolphincontextmenu.cpp


示例15: kgitViewbase

kgitView::kgitView(QWidget *parent)
    : kgitViewbase(parent),
    DCOPObject("kgitIface")
{
  // setup our layout manager to automatically add our widgets
  QHBoxLayout *top_layout = new QHBoxLayout(this);
  top_layout->setAutoAdd(true);

  // we want to look for all components that satisfy our needs.  the
  // trader will actually search through *all* registered KDE
  // applications and components -- not just KParts.  So we have to
  // specify two things: a service type and a constraint
  //
  // the service type is like a mime type.  we say that we want all
  // applications and components that can handle HTML -- 'text/html'
  //
  // however, by itself, this will return such things as Netscape..
  // not what we wanted.  so we constrain it by saying that the
  // string 'KParts/ReadOnlyPart' must be found in the ServiceTypes
  // field.  with this, only components of the type we want will be
  // returned.
  KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KParts/ReadWritePart' in ServiceTypes");

  KLibFactory *factory = 0;
  // in theory, we only care about the first one.. but let's try all
  // offers just in case the first can't be loaded for some reason
  KTrader::OfferList::Iterator it(offers.begin());
  for( ; it != offers.end(); ++it)
  {
    KService::Ptr ptr = (*it);

    // we now know that our offer can handle HTML and is a part.
    // since it is a part, it must also have a library... let's try to
    // load that now
    factory = KLibLoader::self()->factory( ptr->library() );
    if (factory)
    {
      m_html = static_cast<KParts::ReadWritePart *>(factory->create(this/*(QWidget *)layout4->parent()*/, ptr->name(), "KParts::ReadWritePart"));
      break;
    }
  }

  // if our factory is invalid, then we never found our component
  // and we might as well just exit now
  if (!factory)
  {
    KMessageBox::error(this, i18n("Could not find a suitable HTML component"));
    return;
  }

  //layout4->addWidget(m_html->widget());
  m_html->widget()->hide();
  connect(m_html, SIGNAL(setWindowCaption(const QString&)),
          this,   SLOT(slotSetTitle(const QString&)));
  connect(m_html, SIGNAL(setStatusBarText(const QString&)),
          this,   SLOT(slotOnURL(const QString&)));

	gitProc = new KProcIO;

	connect((QObject *)CommitButton,SIGNAL(clicked()),this,SLOT(slotCommitCurrent()));	
	connect((QObject *)DiscardChangesButton,SIGNAL(clicked()),this,SLOT(slotDiscardChanges()));	
	connect((QObject *)UndoCommitButton,SIGNAL(clicked()),this,SLOT(slotUndoLastCommit()));	
	connect((QObject *)RevertCommitButton,SIGNAL(clicked()),this,SLOT(slotRevertCommit()));	
	connect((QObject *)CherryPickFromOtherButton,SIGNAL(clicked()),this,SLOT(slotCherryPickFromOther()));	
	connect((QObject *)SendPatchButton,SIGNAL(clicked()),this,SLOT(slotSendPatch()));	
	
	connect(comboBoxBranches, SIGNAL(activated(const QString&)),this,SLOT(slotGitChangeBranch(const QString&)));

	connect(ShortLogList, SIGNAL(doubleClicked( QListViewItem *, const QPoint &, int ) ),this,SLOT(slotGitShowCommitDiff()));
	ShortLogList->setSorting(-1);

	connect(RepoTreeList, SIGNAL(selectionChanged()),this,SLOT(slotUpdateFilesToCommit()));
	connect(FileListFilterText, SIGNAL(textChanged ( const QString & )),this,SLOT(slotFileFilter(const QString &)));
	
	commit_files = new QStringList;
	branches = new QStringList;

	busyWaiting=0;
}
开发者ID:fredollinger,项目名称:kscope-kde4,代码行数:79,代码来源:kgitview.cpp


示例16: CollectionSetup

AmarokConfigDialog::AmarokConfigDialog( QWidget *parent, const char* name, KConfigSkeleton *config )
        : KConfigDialog( parent, name, config )
        , m_engineConfig( 0 )
        , m_opt4( 0 )
{
    setWFlags( WDestructiveClose );

    // IMPORTANT Don't simply change the page names, they are used as identifiers in other parts of the app.
            m_opt1 = new Options1( 0, "General" );
            m_opt2 = new Options2( 0, "Appearance" );
            m_opt4 = new Options4( 0, "Playback" );
    Options5 *opt5 = new Options5( 0, "OSD" );
    QVBox    *opt6 = new QVBox;
            m_opt7 = new Options7( 0, "Collection" );
    Options8 *opt8 = new Options8( 0, "Scrobbler" );
    QVBox    *opt9 = new QVBox;

    // Sound System
    opt6->setName( "Engine" );
    opt6->setSpacing( KDialog::spacingHint() );
    QWidget *groupBox, *aboutEngineButton;
    groupBox            = new QGroupBox( 2, Qt::Horizontal, i18n("Sound System"), opt6 );
    m_engineConfigFrame = new QGroupBox( 1, Qt::Horizontal, opt6 );
    m_soundSystem       = new QComboBox( false, groupBox );
    aboutEngineButton   = new QPushButton( i18n("About"), groupBox );

    QToolTip::add( m_soundSystem, i18n("Click to select the sound system to use for playback.") );
    QToolTip::add( aboutEngineButton, i18n("Click to get the plugin information.") );

    /// Populate the engine selection combo box
    KTrader::OfferList offers = PluginManager::query( "[X-KDE-amaroK-plugintype] == 'engine'" );
    KTrader::OfferList::ConstIterator end( offers.end() );
    for( KTrader::OfferList::ConstIterator it = offers.begin(); it != end; ++it ) {
        // Don't list the <no engine> (void engine) entry if it's not currenty active,
        // cause there's no point in choosing this engine (it's a dummy, after all).
        if( (*it)->property( "X-KDE-amaroK-name" ).toString() == "void-engine"
            && AmarokConfig::soundSystem() != "void-engine" ) continue;

        m_soundSystem->insertItem( (*it)->name() );
        // Save name properties in QMap for lookup
        m_pluginName[(*it)->name()] = (*it)->property( "X-KDE-amaroK-name" ).toString();
        m_pluginAmarokName[(*it)->property( "X-KDE-amaroK-name" ).toString()] = (*it)->name();
    }

    // Collection
#if !defined(USE_MYSQL) && !defined(USE_POSTGRESQL)
    m_opt7->databaseBox->hide();
#endif

#ifndef USE_MYSQL
    //FIXME we do this because this widget breaks the Apply button (always enabled).
    //It breaks because it is set to type="password" in the .kcfg file. Setting to
    //type="string" also fixes this bug, but means the password is stored in plain
    //text. This is a temporary fix so that the majority of users get a fixed Apply
    //button.
    delete m_opt7->dbSetupFrame->kcfg_MySqlPassword2;
#endif
    m_opt7->collectionFoldersBox->setColumns( 1 );
    new CollectionSetup( m_opt7->collectionFoldersBox ); //TODO this widget doesn't update the apply/ok buttons

    // Media Devices
    opt9->setName( "Media Devices" );
    opt9->setSpacing( KDialog::spacingHint() );
    QVBox *topbox = new QVBox( opt9 );
    topbox->setSpacing( KDialog::spacingHint() );
    QGroupBox *mediaBox  = new QGroupBox( 2, Qt::Horizontal, i18n("Media Devices"), topbox );
    mediaBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
    QVBox *vbox = new QVBox( mediaBox );
    vbox->setSpacing( KDialog::spacingHint() );
    m_deviceManager = new MediumPluginManager( vbox );

    QHBox *hbox = new QHBox( topbox );
    hbox->setSpacing( KDialog::spacingHint() );
    hbox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
    KPushButton *autodetect = new KPushButton( i18n( "Autodetect Devices" ), hbox );
    autodetect->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
    connect( autodetect, SIGNAL(clicked()), m_deviceManager, SLOT(redetectDevices()) );
    KPushButton *add = new KPushButton( i18n( "Add Device..." ), hbox );
    add->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
    connect( add, SIGNAL(clicked()), m_deviceManager, SLOT(newDevice()) );

    QFrame *frame = new QFrame( topbox );
    frame->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );

    // add pages
    addPage( m_opt1, i18n( "General" ), "misc", i18n( "Configure General Options" ) );
    addPage( m_opt2, i18n( "Appearance" ), "colors", i18n( "Configure amaroK's Appearance" ) );
    addPage( m_opt4, i18n( "Playback" ), "kmix", i18n( "Configure Playback" ) );
    addPage( opt5,   i18n( "OSD" ), "tv", i18n( "Configure On-Screen-Display" ) );
    addPage( opt6,   i18n( "Engine" ), "amarok", i18n( "Configure Engine" ) );
    addPage( m_opt7, i18n( "Collection" ), amaroK::icon( "collection" ), i18n( "Configure Collection" ) );
    addPage( opt8,   i18n( "last.fm" ), "audioscrobbler", i18n( "Configure last.fm Support" ) );
    addPage( opt9,   i18n( "Media Devices" ), amaroK::icon( "device" ), i18n( "Configure Portable Player Support" ) );

    // Show information labels (must be done after insertions)
    QObjectList *list = queryList( "QLabel", "infoPixmap" );
    for( QObject *label = list->first(); label; label = list->next() )
        static_cast<QLabel*>(label)->setPixmap( QMessageBox::standardIcon( QMessageBox::Information ) );
    delete list;

//.........这里部分代码省略.........
开发者ID:tmarques,项目名称:waheela,代码行数:101,代码来源:configdialog.cpp


示例17: slotNewProjectLoaded

void DebuggerManager::slotNewProjectLoaded(const QString &projectname, const KURL &, const KURL &)
{
  if(m_client)
  {
    
    disconnect(m_client, SIGNAL(updateStatus(DebuggerUI::DebuggerStatus)), m_debuggerui, SLOT(slotStatus(DebuggerUI::DebuggerStatus)));

    delete m_client;
    m_client = NULL;
  }
  enableAction("*", false);
  
  // Remove all breakpoints
  m_breakpointList->clear();
  
  if(m_debuggerui)
  {
    delete m_debuggerui;
    m_debuggerui = NULL;
  }
  //kdDebug(24002) << "DebuggerManager::slotNewProjectLoaded " << projectname << ", " << Project::ref()->debuggerClient << endl;

  // Load new client
  if(!projectname.isEmpty())
  {

    KTrader::OfferList offers = KTrader::self()->query("Quanta/Debugger");
    KTrader::OfferList::ConstIterator iterDbg;
    for(iterDbg = offers.begin(); iterDbg != offers.end(); ++iterDbg)
    {
      KService::Ptr service = *iterDbg;
      if(Project::ref()->debuggerClient() == service->name())
      {
        int errCode = 0;
//Workaround for dynamic_cast not working correctly on SUSE 10, gcc 4.0.2
//The correct way should be a simple:
// m_client = KParts::ComponentFactory::createInstanceFromService<DebuggerClient>(service, this, 0, QStringList(), &errCode);
        QObject* obj = KParts::ComponentFactory::createInstanceFromService<QObject>(service, this, 0, QStringList(), &errCode);
        if (obj && obj->inherits("DebuggerClient"))
          m_client = static_cast<DebuggerClient *>(obj);

        //kdDebug(24002) << service->name() << " (" << m_client << ")" << endl;

        if(!m_client)
        {
          emit hideSplash();
          KMessageBox::error(NULL, i18n("<qt>Unable to load the debugger plugin, error code %1 was returned: <b>%2</b>.</qt>").arg(errCode).arg(KLibLoader::self()->lastErrorMessage()), i18n("Debugger Error"));
        }
        break;
      }
    }
  }

  // Tell client to load its settings
  if (m_client)
  {
    QDomNode nodeThisDbg;
    QDomDocument *dom = Project::ref()->sessionDom();
    QDomNode projectNode = dom->firstChild().firstChild();
    QDomNode nodeDbg  = projectNode.namedItem("debuggers");
    if(nodeDbg.isNull())
    {
      nodeDbg = dom->createElement("debuggers");
      projectNode.appendChild(nodeDbg);
    }

    // Load this project's mapped paths
    m_pathmapper->readConfig();
    
    // Load this projects debugger's settings
    nodeThisDbg = nodeDbg.namedItem(m_client->getName());
    if(nodeThisDbg.isNull())
    {
      nodeThisDbg = dom->createElement(m_client->getName());
      nodeDbg.appendChild(nodeThisDbg);
    }

    m_client->readConfig(nodeThisDbg);

    // recreate UI
    m_debuggerui = new DebuggerUI(this, "debuggerui");
    connect(m_client, SIGNAL(updateStatus(DebuggerUI::DebuggerStatus)), m_debuggerui, SLOT(slotStatus(DebuggerUI::DebuggerStatus)));
    
    // Load saved breakpoints
    if(Project::ref()->debuggerPersistentBreakpoints())
    {
      QDomNode nodeBreakpoints = nodeDbg.namedItem("breakpoints");
      if(!nodeBreakpoints.isNull())
      {
        QDomNode child = nodeBreakpoints.firstChild();
        while(!child.isNull())
        {
          DebuggerBreakpoint* bp = new DebuggerBreakpoint();
          bp->setFilePath( child.attributes().namedItem("filepath").nodeValue());
          bp->setClass( child.attributes().namedItem("class").nodeValue());
          bp->setFunction( child.attributes().namedItem("function").nodeValue());
          bp->setCondition( child.attributes().namedItem("condition").nodeValue());
          bp->setLine( child.attributes().namedItem("line").nodeValue().toLong());
          if(child.attributes().namedItem("type").nodeValue() == "true")
            bp->setType(DebuggerBreakpoint::ConditionalTrue);
//.........这里部分代码省略.........
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:101,代码来源:debuggermanager.cpp


示例18: slotOptions

void Project::slotOptions()
{
  KURL url;
  KDialogBase optionsDlg(KDialogBase::Tabbed, WStyle_DialogBorder, d->m_mainWindow, "project_options", true, i18n("Project Settings"), KDialogBase::Ok | KDialogBase::Cancel);
 // optionsDlg.setMainWidget(&optionsPage);

 //add the main options page
  QFrame *page = optionsDlg.addPage(i18n("Options"));
  ProjectOptions optionsPage(page);
  QVBoxLayout *topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
  topLayout->addWidget(&optionsPage);

  optionsPage.linePrjName->setText( d->projectName );
  url = QExtFileInfo::toRelative(d->templateURL, d->baseURL);
  optionsPage.linePrjTmpl->setText(QuantaCommon::qUrl(url));
  url = QExtFileInfo::toRelative(d->toolbarURL, d->baseURL);
  optionsPage.linePrjToolbar->setText( QuantaCommon::qUrl(url) );

  optionsPage.lineAuthor->setText( d->author );
  optionsPage.lineEmail->setText( d->email );

  // Signals to handle debugger settings
  connect(optionsPage.buttonDebuggerOptions, SIGNAL(clicked()),
          d, SLOT(slotDebuggerOptions()));
  connect(optionsPage.comboDebuggerClient, SIGNAL(activated(const QString &)),
          d, SLOT(slotDebuggerChanged(const QString &)));


  // Debuggers Combo
  KTrader::OfferList offers = KTrader::self()->query("Quanta/Debugger");
  KTrader::OfferList::ConstIterator iterDbg;
  optionsPage.comboDebuggerClient->clear();
  optionsPage.comboDebuggerClient->insertItem(i18n("No Debugger"));
  int idxDbg = 0;
  d->m_debuggerClientEdit = d->debuggerClient;
  optionsPage.buttonDebuggerOptions->setEnabled(false);
  for(iterDbg = offers.begin(); iterDbg != offers.end(); ++iterDbg)
  {
    KService::Ptr service = *iterDbg;
    optionsPage.comboDebuggerClient->insertItem(service->name());
    idxDbg++;
    if(d->debuggerClient == service->name())
    {
      optionsPage.comboDebuggerClient->setCurrentItem(idxDbg);
      optionsPage.buttonDebuggerOptions->setEnabled(true);
    }
  }
  optionsPage.checkDebuggerPersistentBreakpoints->setChecked(d->m_debuggerPersistentBreakpoints);
  optionsPage.checkDebuggerPersistentWatches->setChecked(d->m_debuggerPersistentWatches);

  QString excludeStr;
  for (uint i = 0; i < d->excludeList.count(); i++)
  {
    excludeStr.append(d->excludeList[i]);
    excludeStr.append(";");
  }
  optionsPage.lineExclude->setText(excludeStr);
  optionsPage.checkCvsignore->setChecked(d->m_excludeCvsignore);

  optionsPage.linePrefix->setText(d->previewPrefix.prettyURL());
  QStringList lst = DTDs::ref()->nickNameList(true);
  uint pos = 0;
  for (uint i = 0; i < lst.count(); i++)
  {
    optionsPage.dtdCombo->insertItem(lst[i]);
    if (lst[i] == DTDs::ref()->getDTDNickNameFromName(d->m_defaultDTD))
       pos = i;
  }
  optionsPage.dtdCombo->setCurrentItem(pos);


  QStringList availableEncodingNames(KGlobal::charsets()->availableEncodingNames());
  optionsPage.encodingCombo->insertStringList( availableEncodingNames );
  QStringList::ConstIterator iter;
  int iIndex = -1;
  for (iter = availableEncodingNames.begin(); iter != availableEncodingNames.end(); ++iter)
  {
     ++iIndex;
     if ((*iter).lower() == d->m_defaultEncoding.lower())
     {
       optionsPage.encodingCombo->setCurrentItem(iIndex);
       break;
     }
  }


  QStringList list = d->projectViewList();
  QString defaultView = d->dom.firstChild().firstChild().namedItem("autoload").toElement().attribute("projectview");
  if (list.count() > 0)
  {
    optionsPage.viewCombo->insertStringList(list);
    for (uint i = 0; i < list.count(); i++)
    {
      if (list[i] == defaultView)
      {
        optionsPage.viewCombo->setCurrentItem(i);
        break;
      }
    }
  } else
//.........这里部分代码省略.........
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:101,代码来源:project.cpp


示例19: createSyncPlugin

int SyncTaskListItem::createSyncPlugin(bool state)
{
    int ret = 0;

    if (syncPlugin != NULL) {
        syncPlugin->unInit();
        delete syncPlugin;
        syncPlugin = NULL;
    }

    if (state) {
        KTrader::OfferList offers;

        QString library = getPreferedLibrary();
        QString offer = getPreferedOffer();

        if (library.isEmpty()) {
            offers = getOffers();
            if (offers.begin() != offers.end()) {
                KService::Ptr service = *offers.begin();
                library = service->library();
                offer = service->name();
            }
        }

        if (!library.isEmpty()) {
            kdDebug(2120) << i18n("Name:") << " " << offer << "; "
            << i18n("Library:") << " " << library << endl;
            KLibFactory *factory = KLibLoader::self()->factory(library.ascii()) 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ kurl::List类代码示例发布时间:2022-05-31
下一篇:
C++ attribute::Ptr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap