本文整理汇总了C++中TQStringList::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ TQStringList::begin方法的具体用法?C++ TQStringList::begin怎么用?C++ TQStringList::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TQStringList
的用法示例。
在下文中一共展示了TQStringList::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCommand
void KXmlCommandDlg::setCommand(KXmlCommand *xmlCmd)
{
setCaption(i18n("Command Edit for %1").arg(xmlCmd->name()));
m_cmd = xmlCmd;
m_description->setText(i18n(xmlCmd->description().utf8()));
m_idname->setText(xmlCmd->name());
m_requirements->clear();
TQStringList list = xmlCmd->requirements();
TQListViewItem *item(0);
for (TQStringList::ConstIterator it=list.begin(); it!=list.end(); ++it)
{
item = new TQListViewItem(m_requirements, item, *it);
item->setRenameEnabled(0, true);
}
int index = m_mimelist.findIndex(xmlCmd->mimeType());
if (index != -1)
m_mimetype->setCurrentItem(index);
else
m_mimetype->setCurrentItem(0);
list = xmlCmd->inputMimeTypes();
m_selectedmime->clear();
m_availablemime->clear();
m_availablemime->insertStringList(m_mimelist);
for (TQStringList::ConstIterator it=list.begin(); it!=list.end(); ++it)
{
m_selectedmime->insertItem(*it);
delete m_availablemime->findItem(*it, TQt::ExactMatch);
}
}
示例2: list
// static
TQStringList TDEIconTheme::list()
{
// Static pointer because of unloading problems wrt DSO's.
if (_theme_list != 0L)
return *_theme_list;
_theme_list = new TQStringList();
TQStringList icnlibs = TDEGlobal::dirs()->resourceDirs("icon");
icnlibs += (TDEGlobal::dirs()->resourceDirs("xdgdata-icon"));
icnlibs += "/usr/share/pixmaps";
// These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
icnlibs += TDEGlobal::dirs()->resourceDirs("xdgdata-pixmap");
TQStringList::ConstIterator it;
for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
{
TQDir dir(*it);
if (!dir.exists())
continue;
TQStringList lst = dir.entryList(TQDir::Dirs);
TQStringList::ConstIterator it2;
for (it2=lst.begin(); it2!=lst.end(); ++it2)
{
if ((*it2 == ".") || (*it2 == "..") || (*it2).startsWith("default.") )
continue;
if (!TDEStandardDirs::exists(*it + *it2 + "/index.desktop") && !TDEStandardDirs::exists(*it + *it2 + "/index.theme"))
continue;
TDEIconTheme oink(*it2);
if (!oink.isValid()) continue;
if (!_theme_list->contains(*it2))
_theme_list->append(*it2);
}
}
return *_theme_list;
}
示例3: insertItems
void TDECompletion::insertItems( const TQStringList& items )
{
bool weighted = (myOrder == Weighted);
TQStringList::ConstIterator it;
if ( weighted ) { // determine weight
for ( it = items.begin(); it != items.end(); ++it )
addWeightedItem( *it );
}
else {
for ( it = items.begin(); it != items.end(); ++it )
addItem( *it, 0 );
}
}
示例4: findThemeDirs
TQStringList IconThemesConfig::findThemeDirs(const TQString &archiveName)
{
TQStringList foundThemes;
KTar archive(archiveName);
archive.open(IO_ReadOnly);
const KArchiveDirectory* themeDir = archive.directory();
KArchiveEntry* possibleDir = 0L;
KArchiveDirectory* subDir = 0L;
// iterate all the dirs looking for an index.theme or index.desktop file
TQStringList entries = themeDir->entries();
for (TQStringList::Iterator it = entries.begin();
it != entries.end();
++it) {
possibleDir = const_cast<KArchiveEntry*>(themeDir->entry(*it));
if (possibleDir->isDirectory()) {
subDir = dynamic_cast<KArchiveDirectory*>( possibleDir );
if (subDir && (subDir->entry("index.theme") != NULL ||
subDir->entry("index.desktop") != NULL))
foundThemes.append(subDir->name());
}
}
archive.close();
return foundThemes;
}
示例5: init
void KMDriverDB::init(TQWidget *parent)
{
TQFileInfo dbfi(dbFile());
TQString dirname = KMFactory::self()->manager()->driverDirectory();
TQStringList dbDirs = TQStringList::split(':', dirname, false);
bool createflag(false);
for (TQStringList::ConstIterator it=dbDirs.begin(); it!=dbDirs.end() && !createflag; ++it)
if (!(*it).startsWith("module:") && !m_creator->checkDriverDB(*it, dbfi.lastModified()))
createflag = true;
if (createflag)
{
// starts DB creation and wait for creator signal
if (!m_creator->createDriverDB(dirname,dbfi.absFilePath(),parent))
KMessageBox::error(parent, KMFactory::self()->manager()->errorMsg().prepend("<qt>").append("</qt>"));
}
else if (m_entries.count() == 0)
{
// call directly the slot as the DB won't be re-created
// this will (re)load the driver DB
slotDbCreated();
}
else
// no need to refresh, and already loaded, just emit signal
emit dbLoaded(false);
}
示例6: clear
void TDERecentDocument::clear()
{
TQStringList list = recentDocuments();
TQDir dir;
for(TQStringList::Iterator it = list.begin(); it != list.end() ; ++it)
dir.remove(*it);
}
示例7: searchAddCert
void KSSLD::searchAddCert(KSSLCertificate *cert) {
skMD5Digest.insert(cert->getMD5Digest(), cert, true);
TQStringList mails;
cert->getEmails(mails);
for(TQStringList::const_iterator iter = mails.begin(); iter != mails.end(); ++iter) {
TQString email = static_cast<const TQString &>(*iter).lower();
TQMap<TQString, TQPtrVector<KSSLCertificate> >::iterator it = skEmail.find(email);
if (it == skEmail.end())
it = skEmail.insert(email, TQPtrVector<KSSLCertificate>());
TQPtrVector<KSSLCertificate> &elem = *it;
if (elem.findRef(cert) == -1) {
unsigned int n = 0;
for(; n < elem.size(); n++) {
if (!elem.at(n)) {
elem.insert(n, cert);
break;
}
}
if (n == elem.size()) {
elem.resize(n+1);
elem.insert(n, cert);
}
}
}
}
示例8: addFile
void SevenZipArch::addFile( const TQStringList & urls )
{
TDEProcess *kp = m_currentProcess = new TDEProcess;
kp->clearArguments();
*kp << m_archiver_program << "a" ;
if ( !m_password.isEmpty() )
*kp << "-p" + m_password;
KURL url( urls.first() );
TQDir::setCurrent( url.directory() );
*kp << m_filename;
TQStringList::ConstIterator iter;
for ( iter = urls.begin(); iter != urls.end(); ++iter )
{
KURL url( *iter );
*kp << url.fileName();
}
connect( kp, TQT_SIGNAL( receivedStdout(TDEProcess*, char*, int) ),
TQT_SLOT( slotReceivedOutput(TDEProcess*, char*, int) ) );
connect( kp, TQT_SIGNAL( receivedStderr(TDEProcess*, char*, int) ),
TQT_SLOT( slotReceivedOutput(TDEProcess*, char*, int) ) );
connect( kp, TQT_SIGNAL( processExited(TDEProcess*) ),
TQT_SLOT( slotAddExited(TDEProcess*) ) );
if ( !kp->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput ) )
{
KMessageBox::error( 0, i18n( "Could not start a subprocess." ) );
emit sigAdd( false );
}
}
示例9: KURL
KURL *decodeImgDrop(TQDropEvent *e, TQWidget *wdg)
{
KURL::List uris;
if (KURLDrag::decode(e, uris) && (uris.count() > 0)) {
KURL *url = new KURL(uris.first());
KImageIO::registerFormats();
if( KImageIO::canRead(KImageIO::type(url->fileName())) )
return url;
TQStringList qs = TQStringList::split('\n', KImageIO::pattern());
qs.remove(qs.begin());
TQString msg = i18n( "%1 "
"does not appear to be an image file.\n"
"Please use files with these extensions:\n"
"%2")
.arg(url->fileName())
.arg(qs.join("\n"));
KMessageBox::sorry( wdg, msg);
delete url;
}
return 0;
}
示例10: readSchemeNames
void ShortcutsModule::readSchemeNames()
{
TQStringList schemes = TDEGlobal::dirs()->findAllResources("data", "kcmkeys/*.kksrc");
m_pcbSchemes->clear();
m_rgsSchemeFiles.clear();
i18n("User-Defined Scheme");
m_pcbSchemes->insertItem( i18n("Current Scheme") );
m_rgsSchemeFiles.append( "cur" );
// This for system files
for ( TQStringList::ConstIterator it = schemes.begin(); it != schemes.end(); ++it) {
// KPersonalizer relies on .kksrc files containing all the keyboard shortcut
// schemes for various setups. It also requires the TDE defaults to be in
// a .kksrc file. The TDE defaults shouldn't be listed here.
//if( r.search( *it ) != -1 )
// continue;
KSimpleConfig config( *it, true );
config.setGroup( "Settings" );
TQString str = config.readEntry( "Name" );
m_pcbSchemes->insertItem( str );
m_rgsSchemeFiles.append( *it );
}
}
示例11: restoreLegacySession
/*!
Restores legacy session management data (i.e. restart applications)
*/
void KSMServer::restoreLegacySession( TDEConfig* config )
{
if( config->hasGroup( "Legacy" + sessionGroup )) {
TDEConfigGroupSaver saver( config, "Legacy" + sessionGroup );
restoreLegacySessionInternal( config );
} else if( wm == "twin" ) { // backwards comp. - get it from twinrc
TDEConfigGroupSaver saver( config, sessionGroup );
int count = config->readNumEntry( "count", 0 );
for ( int i = 1; i <= count; i++ ) {
TQString n = TQString::number(i);
if ( config->readEntry( TQString("program")+n ) != wm )
continue;
TQStringList restartCommand =
config->readListEntry( TQString("restartCommand")+n );
for( TQStringList::ConstIterator it = restartCommand.begin();
it != restartCommand.end();
++it ) {
if( (*it) == "-session" ) {
++it;
if( it != restartCommand.end()) {
TDEConfig cfg( "session/" + wm + "_" + (*it), true );
cfg.setGroup( "LegacySession" );
restoreLegacySessionInternal( &cfg, ' ' );
}
}
}
}
}
}
示例12: printList
static void printList( const TQStringList& list )
{
TQStringList::ConstIterator it = list.begin();
for ( ; it != list.end(); ++it )
cout << (*it).local8Bit().data() << endl;
cout << endl;
}
示例13: loadGuiStyles
void TDMAppearanceWidget::loadGuiStyles(KBackedComboBox *combo)
{
// XXX: Global + local schemes
TQStringList list = TDEGlobal::dirs()->
findAllResources("data", "tdestyle/themes/*.themerc", false, true);
for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
{
KSimpleConfig config(*it, true);
if (!(config.hasGroup("KDE") && config.hasGroup("Misc")))
continue;
config.setGroup("Desktop Entry");
if (config.readBoolEntry("Hidden", false))
continue;
config.setGroup("KDE");
TQString str2 = config.readEntry("WidgetStyle");
if (str2.isNull())
continue;
config.setGroup("Misc");
combo->insertItem( str2, config.readEntry("Name") );
}
}
示例14: recursive_transfer
void recursive_transfer(const KArchiveDirectory * dir,
const TQString & path, KZip * zip)
{
TQStringList l = dir->entries();
TQStringList::Iterator it = l.begin();
for( ; it != l.end(); ++it )
{
const KArchiveEntry* e = dir->entry( (*it) );
kdDebug() << "actual file: " << e->name() << endl;
if (e->isFile())
{
Q_ASSERT( e && e->isFile() );
const KArchiveFile* f = (KArchiveFile*)e;
printf("FILE=%s\n", e->name().latin1());
TQByteArray arr( f->data() );
printf("SIZE=%i\n",arr.size() );
TQString str( arr );
printf("DATA=%s\n", str.latin1());
if (e->symlink().isEmpty()) {
zip->writeFile( path+e->name().latin1(),
"holgi", "holgrp",
arr.size() , f->data() );
} else
zip->writeSymLink(path+e->name(), e->symlink(), "leo", "leo",
0120777, 1000000000l, 1000000000l, 1000000000l);
}
else if (e->isDirectory())
{
recursive_transfer((KArchiveDirectory *)e ,
path+e->name()+"/", zip);
}
}
}
示例15: editClock
void ZoneClock::editClock()
{
ClockDialog *_dlg = new ClockDialog(this, 0, true);
CityList cities;
TQStringList timezones = cities.timezones();
for (TQStringList::iterator it = timezones.begin(); it != timezones.end(); ++it)
_dlg->ClockZone->insertItem(i18n((*it).utf8()));
_dlg->ClockCaption->setText(_nameLabel->text().left(_nameLabel->text().length()-1));
for (int i=0; i<_dlg->ClockZone->count(); ++i)
if (_dlg->ClockZone->text(i) == i18n(_zone.utf8()))
{
_dlg->ClockZone->setCurrentItem(i);
break;
}
if (_dlg->exec() == TQDialog::Accepted)
{
_zone = timezones[_dlg->ClockZone->currentItem()];
_name = _dlg->ClockCaption->text().append(":");
_nameLabel->setText(_dlg->ClockCaption->text().append(":"));
updateTime();
layout()->invalidate();
emit changed();
}
delete _dlg;
}