当前位置: 首页>>代码示例>>C++>>正文


C++ QCStringList::end方法代码示例

本文整理汇总了C++中QCStringList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ QCStringList::end方法的具体用法?C++ QCStringList::end怎么用?C++ QCStringList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QCStringList的用法示例。


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

示例1: updateObjects

void AddAction::updateObjects()
{
	QStringList names;
	theObjects->clear();
	uniqueProgramMap.clear();
	nameProgramMap.clear();

	DCOPClient *theClient = KApplication::kApplication()->dcopClient();
	QCStringList theApps = theClient->registeredApplications();
	for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
	{
		if(!QString(*i).find("anonymous")) continue;
		if(!QString(*i).find(i18n( "anonymous" ))) continue;
		QRegExp r("(.*)-[0-9]+");
		QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i;
		if(names.contains(name)) continue;
		names += name;

		KListViewItem *a = new KListViewItem(theObjects, name);
		uniqueProgramMap[a] = name == QString(*i);
		nameProgramMap[a] = *i;

		QCStringList theObjects = theClient->remoteObjects(*i);
		for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
			if(*j != "ksycoca" && *j != "qt")// && getFunctions(*i, *j).count())
				new KListViewItem(a, *j);
	}
	updateFunctions();
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:29,代码来源:addaction.cpp

示例2: request

Arts::Buffer *MCOPDCOPObject::callFunction(MCOPEntryInfo *entry, TQCString ifaceName, const TQByteArray &data)
{
	Arts::Object workingObject = Arts::SubClass(string(ifaceName));
	Arts::DynamicRequest request(workingObject);
	request.method(string(entry->functionName()));

	if(entry->signatureList().size() > 0)
	{
		QCStringList list = entry->signatureList();

		QCStringList::iterator it;
		for(it = list.begin(); it != list.end(); ++it)
		{
			TQCString param = *it;

			kdDebug() << "PARAM: " << param << endl;
			
			TQDataStream argStream(data, IO_ReadOnly);

			if(param == "long")
				request.param(MCOPDCOPTools::getLong(argStream));
			else if(param == "string")
				request.param(MCOPDCOPTools::getString(argStream));
		}
	}

	Arts::AnyRef result;	
	if(!request.invoke(result))
		return 0;

	Arts::Buffer *newBuffer = new Arts::Buffer();
	result.write(newBuffer);

	return newBuffer;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:35,代码来源:mcopdcopobject.cpp

示例3: updateDCOPObjects

void EditAction::updateDCOPObjects()
{
	theDCOPObjects->clear();
	DCOPClient *theClient = TDEApplication::kApplication()->dcopClient();
	if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
	QCStringList theObjects = theClient->remoteObjects(nameProgramMap[theDCOPApplications->currentText()].utf8());
	if(!theObjects.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPObjects->insertItem((*theAction).object());
	for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
		if(*j != "tdesycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count())
			theDCOPObjects->insertItem(TQString::fromUtf8(*j));
	updateDCOPFunctions();
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:12,代码来源:editaction.cpp

示例4: getFunctions

const QStringList AddAction::getFunctions(const QString app, const QString obj)
{
	QStringList ret;
	DCOPClient *theClient = KApplication::kApplication()->dcopClient();
	QCStringList theApps = theClient->remoteFunctions(app.utf8(), obj.utf8());
	for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
		if(	*i != "QCStringList interfaces()" &&
			*i != "QCStringList functions()" &&
			*i != "QCStringList objects()" &&
			*i != "QCStringList find(QCString)" )
			ret += QString::fromUtf8(*i);
	return ret;
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:13,代码来源:addaction.cpp

示例5: commaSeparatedList

TQCString StubProcess::commaSeparatedList(QCStringList lst)
{
    if (lst.count() == 0)
	return TQCString("");

    QCStringList::Iterator it = lst.begin();
    TQCString str = *it;
    for (it++; it!=lst.end(); it++) 
    {
	str += ',';
	str += *it;
    }
    return str;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:14,代码来源:stub.cpp

示例6: initialize

bool KIMProxy::initialize()
{
	if ( !m_initialized )
	{
		m_initialized = true; // we should only do this once, as registeredToDCOP() will catch any new starts
		// So there is no error from a failed query when using tdelibs 3.2, which don't have this servicetype
		if ( KServiceType::serviceType( IM_SERVICE_TYPE ) ) 
		{
			//kdDebug( 790 ) << k_funcinfo << endl;
			TQCString dcopObjectId = "KIMIface";
	
			// see what apps implementing our service type are out there
			KService::List offers = KServiceType::offers( IM_SERVICE_TYPE );
			KService::List::iterator offer;
			typedef TQValueList<TQCString> QCStringList;
			QCStringList registeredApps = d->dc->registeredApplications();
			QCStringList::iterator app;
			const QCStringList::iterator end = registeredApps.end();
			// for each registered app
			for ( app = registeredApps.begin(); app != end; ++app )
			{
				//kdDebug( 790 ) << " considering: " << *app << endl;
				//for each offer
				for ( offer = offers.begin(); offer != offers.end(); ++offer )
				{
					TQCString dcopService = (*offer)->property("X-DCOP-ServiceName").toString().latin1();
					if ( !dcopService.isEmpty() )
					{
						//kdDebug( 790 ) << " is it: " << dcopService << "?" << endl;
						// get the application name ( minus any process ID )
						TQCString instanceName =  (*app).left( dcopService.length() );
						// if the application implements the dcop service, add it 
						if ( instanceName == dcopService )
						{
							m_apps_available = true;
							//kdDebug( 790 ) << " app name: " << (*offer)->name() << ", has instance " << *app << ", dcopService: " << dcopService << endl;
							if ( !m_im_client_stubs.find( dcopService ) )
							{
								kdDebug( 790 ) << "App " << *app << ", dcopObjectId " << dcopObjectId << " found, using it for presence info." << endl;
								m_im_client_stubs.insert( *app, new KIMIface_stub( d->dc, *app, dcopObjectId ) );
								pollApp( *app );
							}
						}
					}
				}
			}
		}
	}
	return !m_im_client_stubs.isEmpty();
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:50,代码来源:tdeimproxy.cpp

示例7: isRunning

bool NoatunSensor::isRunning()
{
    TQRegExp rx("(noatun)|(noatun-\\d+)");
    QCStringList list = client->registeredApplications();
    TQValueList<TQCString>::iterator it;
    it = list.begin();
    bool foundNoatun = false;
    noatunID = "noatun";
    while( foundNoatun == false && it != list.end() )
    {
        if( rx.search(  *it ) != -1 )
        {
            foundNoatun = true;
            noatunID = *it;
        }
        ++it;
    }
    return ( client->isApplicationRegistered ( noatunID ) );
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:19,代码来源:noatunsensor.cpp

示例8: updateDCOPApplications

void EditAction::updateDCOPApplications()
{
	TQStringList names;

	theDCOPApplications->clear();
	DCOPClient *theClient = TDEApplication::kApplication()->dcopClient();
	QCStringList theApps = theClient->registeredApplications();
	for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
	{
		if(!TQString(*i).find("anonymous")) continue;
		TQRegExp r("(.*)-[0-9]+");
		TQString name = r.exactMatch(TQString(*i)) ? r.cap(1) : *i;
		if(names.contains(name)) continue;
		names += name;

		theDCOPApplications->insertItem(name);
		uniqueProgramMap[name] = name == TQString(*i);
		nameProgramMap[name] = *i;


	}
	updateDCOPObjects();
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:23,代码来源:editaction.cpp

示例9: ConverseStub

int StubProcess::ConverseStub(int check)
{
    TQCString line, tmp;
    while (1) 
    {
	line = readLine();
	if (line.isNull())
	    return -1;

	if (line == "tdesu_stub") 
	{
	    // This makes parsing a lot easier.
	    enableLocalEcho(false);
	    if (check) writeLine("stop");
	    else writeLine("ok");
	} else if (line == "display") {
	    writeLine(display());
	} else if (line == "display_auth") {
#ifdef Q_WS_X11
	    writeLine(displayAuth());
#else
	    writeLine("");
#endif
	} else if (line == "dcopserver") {
	    if (m_bDCOPForwarding)
	       writeLine(dcopServer());
	    else
	       writeLine("no");
	} else if (line == "dcop_auth") {
	    if (m_bDCOPForwarding)
	       writeLine(dcopAuth());
	    else
	       writeLine("no");
	} else if (line == "ice_auth") {
	    if (m_bDCOPForwarding)
	       writeLine(iceAuth());
	    else
	       writeLine("no");
	} else if (line == "command") {
	    writeLine(m_Command);
	} else if (line == "path") {
	    TQCString path = getenv("PATH");
            if (!path.isEmpty() && path[0] == ':')
                path = path.mid(1);
	    if (m_User == "root")
	       if (!path.isEmpty())
	          path = "/usr/local/sbin:/usr/sbin:/sbin:" + path;
	       else
                  if (strcmp(__TDE_BINDIR, "/usr/bin") == 0) {
		          path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin";
		  }
		  else {
			  path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:" __TDE_BINDIR ":/usr/bin:/bin";
		  }
	    writeLine(path);
	} else if (line == "user") {
	    writeLine(m_User);
	} else if (line == "priority") {
	    tmp.setNum(m_Priority);
	    writeLine(tmp);
	} else if (line == "scheduler") {
	    if (m_Scheduler == SchedRealtime) writeLine("realtime");
	    else writeLine("normal");
	} else if (line == "xwindows_only") {
	    if (m_bXOnly) writeLine("no");
	    else writeLine("yes");
	} else if (line == "app_startup_id") {
	    QCStringList env = environment();
	    TQCString tmp;
	    for( QCStringList::ConstIterator it = env.begin();
		 it != env.end();
		 ++it )
	    {
		if( (*it).find( "DESKTOP_STARTUP_ID=" ) == 0 )
		    tmp = (*it).mid( strlen( "DESKTOP_STARTUP_ID=" ));
	    }
	    if( tmp.isEmpty())
		tmp = "0";
	    writeLine(tmp);
	} else if (line == "app_start_pid") { // obsolete
	    tmp.setNum(getpid());
	    writeLine(tmp);
	} else if (line == "environment") { // additional env vars
	    QCStringList env = environment();
	    for( QCStringList::ConstIterator it = env.begin();
		 it != env.end();
		 ++it )
		writeLine( *it );
	    writeLine( "" );
	} else if (line == "end") {
	    return 0;
	} else 
	{
	    kdWarning(900) << k_lineinfo << "Unknown request: -->" << line 
		           << "<--\n";
	    return 1;
	}
    }

    return 0;
//.........这里部分代码省略.........
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:101,代码来源:stub.cpp

示例10: main


//.........这里部分代码省略.........
            kst->show();
        }

        // get Y axis columns
        ycolList = args->getOptionList("y");
        matrixList = args->getOptionList("z");
        yEqList = args->getOptionList("ye");
        psdList = args->getOptionList("p");
        hsList = args->getOptionList("h");
        errorList = args->getOptionList("e");

        // y axis or PSD specified, so the files are data files, not kst files.
        n_y = ycolList.count() + psdList.count() + hsList.count() + yEqList.count() + matrixList.count();
        if (n_y > 0) {
            QString creatingEquations = i18n("Creating equations");
            QString creatingCurves = i18n("Creating curves");
            QString creatingPlots = i18n("Creating plots");
            int count;
            int handled;

            kst->slotUpdateProgress( 0, 0, QString::null );

            SetCMDOptions(args, in, n_y);

            KstTopLevelViewPtr tlv = kst->activeView();

            if (!tlv) {
                // if there was no active view then we create one...
                kst->newWindow(false);
                tlv = kst->activeView();
            }

            if (!tlv) {
                kstdError() << i18n("Can't create a view.") << endl;
                return 0;
            }

            CreatePlots(in, tlv);
            Kst2DPlotList plist = kstObjectSubList<KstViewObject, Kst2DPlot>(tlv->children());

            i_plot = 0;
            Kst2DPlotPtr plot = *plist.at(i_plot);

            KstVCurveList vcurves = kstObjectSubList<KstBaseCurve,KstVCurve>(plot->Curves);

            // make stand alone equations if there are no files
            if (args->count() < 1) {
                if (!yEqList.isEmpty()) {
                    QString eqS;
                    double max, min;
                    int n;
                    bool xeq;

                    SetEqXRanges(args->getOption("xe"), &min, &max, &n, &xeq);
                    if (xeq) {
                        count = yEqList.size();
                        handled = 0;
                        kst->slotUpdateProgress( count, handled, creatingEquations );

                        for (eq_i = yEqList.begin(); eq_i != yEqList.end(); ++eq_i) {
                            eqS = *eq_i;
                            if (NoVectorEq(eqS)) {
                                KstEquationPtr eq = new KstEquation(KST::suggestEQName(eqS), eqS, min, max, n);
                                KstVCurvePtr vc = new KstVCurve(KST::suggestCurveName(eq->tag(), true),
                                                                eq->vX(), eq->vY(), 0L, 0L, 0L, 0L,
                                                                KstColorSequence::next(vcurves,plot->backgroundColor()));
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:67,代码来源:main.cpp

示例11: main

int main( int argc, char **argv )
{
    TDEAboutData about(
	  "tdefile", I18N_NOOP( "tdefile" ), TDEFILEVERSION,
	  I18N_NOOP("A commandline tool to read and modify metadata of files." ),
	  TDEAboutData::License_LGPL, "(c) 2002, Carsten Pfeiffer",
	  0 /*text*/, "http://devel-home.kde.org/~pfeiffer/",
	  "[email protected]" );

    about.addAuthor( "Carsten Pfeiffer", 0, "[email protected]",
		     "http://devel-home.kde.org/~pfeiffer/" );

    TDECmdLineArgs::init( argc, argv, &about );

    TDECmdLineArgs::addCmdLineOptions( options );

    TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
    bool useGUI = args->isSet( "dialog" );

    TDEApplication app( useGUI, useGUI );

    TQPtrList<FileProps> m_props;
    m_props.setAutoDelete( true );

    bool quiet = args->isSet( "quiet" );

    if ( args->isSet( "supportedMimetypes" ) )
        printSupportedMimeTypes();

    int files = args->count();
    if ( files == 0 )
        TDECmdLineArgs::usage( i18n("No files specified") ); // exit()s

    if ( args->isSet( "dialog" ) )
    {
        showPropertiesDialog( args );
        return true;
    }

    TQStringList groupsToUse;
    QCStringList suppliedGroups = args->getOptionList( "groups" );
    QCStringList::ConstIterator it = suppliedGroups.begin();
    for ( ; it != suppliedGroups.end(); ++it )
        groupsToUse.append( TQString::fromLocal8Bit( (*it) ) );

    TQString mimeType;

    for ( int i = 0; i < files; i++ )
    {
        if ( args->isSet( "mimetype" ) )
            printMimeTypes( args );

        FileProps *props = new FileProps( args->url(i).path(), groupsToUse );
        if ( props->isValid() )
            m_props.append( props );
        else
        {
            if ( !quiet )
            {
                cerr << args->arg(i) << ": " <<
                i18n("Cannot determine metadata").local8Bit().data() << endl;
            }
            delete props;
        }
    }


    processMetaDataOptions( m_props, args );

    m_props.clear(); // force destruction/sync of props
    cout.flush();

    return 0;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:74,代码来源:fileprops.cpp


注:本文中的QCStringList::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。