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


C++ TQStringList::append方法代码示例

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


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

示例1: saveState

 bool saveState( TQSessionManager&sm) {
     TQStringList restartCommand = sm.restartCommand();
     if (has_noxft)
         restartCommand.append("--noxft");
     if (login_shell)
         restartCommand.append("--ls");
     if (full_script)
         restartCommand.append("--script");
     if (!auto_close)
         restartCommand.append("--noclose");
     if (fixed_size)
         restartCommand.append("--noresize");
     sm.setRestartCommand(restartCommand);
     return true;
 }
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:15,代码来源:main.cpp

示例2: 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;
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:28,代码来源:iconthemes.cpp

示例3: addCpus

uint CpuConfig::addCpus()
{
#ifdef Q_OS_LINUX
  TQStringList output;
  TQString parser;
  TQFile file("/proc/stat");
  if (!file.open(IO_ReadOnly))
    return 0;

  // Parse the proc file
  TQTextStream procStream(&file);
  while (!procStream.atEnd()) {
    parser = procStream.readLine();
    if (TQRegExp("cpu").search(parser, 0) != -1
          && TQRegExp("cpu0").search(parser, 0) == -1) {
      output.append(parser);
    }
  }

  return output.count();
#endif

#ifdef Q_OS_BSD4
  int mib[] = { CTL_HW, HW_NCPU }; // hw.ncpu
  uint cpu;
  size_t cpuLen = sizeof(cpu);
  if (sysctl(mib, 2, &cpu, &cpuLen, NULL, 0) < 0)
    return 0;

  return cpu;
#endif
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:32,代码来源:ksimcpu.cpp

示例4: caReadCerticatesFromFile

/**
  * @internal
  * Returns a list of certificates as QStrings read from the given file
  */
static TQStringList caReadCerticatesFromFile(TQString filename) {

	TQStringList certificates;
	TQString certificate, temp;
	TQFile file(filename);

	if (!file.open(IO_ReadOnly))
		return certificates;

	while (!file.atEnd()) {
		file.readLine(temp, 999);
		if (temp.startsWith("-----BEGIN CERTIFICATE-----")) {
			certificate = TQString::null;
			continue;
		}

		if (temp.startsWith("-----END CERTIFICATE-----")) {
			certificates.append(certificate);
			certificate = TQString::null;
			continue;
		}

		certificate += temp.stripWhiteSpace();
	}

	file.close();

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

示例5: pluginNames

TQStringList KURIFilter::pluginNames() const
{
    TQStringList list;
    for(TQPtrListIterator<KURIFilterPlugin> i = pluginsIterator(); *i; ++i)
        list.append((*i)->name());
    return list;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:7,代码来源:kurifilter.cpp

示例6: TQWidget

KPaletteTable::KPaletteTable( TQWidget *parent, int minWidth, int cols)
    : TQWidget( parent ), cells(0), mPalette(0), mMinWidth(minWidth), mCols(cols)
{
  d = new KPaletteTablePrivate;
  
  i18n_namedColors  = i18n("Named Colors");

  TQStringList diskPaletteList = KPalette::getPaletteList();
  TQStringList paletteList;

  // We must replace the untranslated file names by translate names (of course only for KDE's standard palettes)
  for ( int i = 0; colorPaletteName[i].m_fileName; ++i )
  {
      diskPaletteList.remove( colorPaletteName[i].m_fileName );
      paletteList.append( i18n( "palette name", colorPaletteName[i].m_displayName ) );
  }
  paletteList += diskPaletteList;
  paletteList.append( i18n_namedColors );

  TQVBoxLayout *layout = new TQVBoxLayout( this );

  combo = new TQComboBox( false, this );
  combo->insertStringList( paletteList );
  layout->addWidget(combo);

  sv = new TQScrollView( this );
  TQSize cellSize = TQSize( mMinWidth, 120);
  sv->setHScrollBarMode( TQScrollView::AlwaysOff);
  sv->setVScrollBarMode( TQScrollView::AlwaysOn);
  TQSize minSize = TQSize(sv->verticalScrollBar()->width(), 0);
  minSize += TQSize(sv->frameWidth(), 0);
  minSize += TQSize(cellSize);
  sv->setFixedSize(minSize);
  layout->addWidget(sv);

  mNamedColorList = new TDEListBox( this, "namedColorList", 0 );
  mNamedColorList->setFixedSize(minSize);
  mNamedColorList->hide();
  layout->addWidget(mNamedColorList);
  connect( mNamedColorList, TQT_SIGNAL(highlighted( const TQString & )),
	   this, TQT_SLOT( slotColorTextSelected( const TQString & )) );

  setFixedSize( sizeHint());
  connect( combo, TQT_SIGNAL(activated(const TQString &)),
	this, TQT_SLOT(slotSetPalette( const TQString &)));
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:46,代码来源:kcolordialog.cpp

示例7: addDir

void SevenZipArch::addDir( const TQString & dirName )
{
  if ( !dirName.isEmpty() )
  {
    TQStringList list;
    list.append( dirName );
    addFile( list );
  }
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:9,代码来源:sevenzip.cpp

示例8:

void KSim::MemoryPrefs::saveConfig(KSim::Config *config)
{
  config->setMemoryItem(m_memCombo->currentItem());
  config->setShowMemory(m_memCheck->isChecked());

  TQStringList comboItems;
  for (int i = 0; i < m_memCombo->count(); i++)
    comboItems.append(m_memCombo->text(i));

  config->setMemoryFormat(comboItems);
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:11,代码来源:generalprefs.cpp

示例9: onlineContacts

TQStringList KIMProxy::onlineContacts()
{
	TQStringList value;
	PresenceStringMap::iterator it = d->presence_map.begin();
	const PresenceStringMap::iterator end= d->presence_map.end();
	for ( ; it != end; ++it )
		if ( it.data().best().presence > 2 /*Better than Connecting, ie Away or Online*/ )
			value.append( it.key() );
		
	return value;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:11,代码来源:tdeimproxy.cpp

示例10: createKeyValueList

// static
TQStringList FileProps::createKeyValueList( const KFileMetaInfoGroup& g,
                                           const TQStringList& keys )
{
    TQStringList result;
    TQStringList::ConstIterator it = keys.begin();

    for ( ; it != keys.end(); ++it )
        result.append( FileProps::createKeyValue( g, *it ) );

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

示例11: determineFileSystemType

TQString TDEStorageDevice::determineFileSystemType(TQString path) {
	TQStringList mountTable;
	TQString prevPath = path;
	dev_t prevDev = 0;
	int pos;
	struct stat directory_info;
	if (path.startsWith("/")) {
		stat(path.local8Bit(), &directory_info);
		prevDev = directory_info.st_dev;
		// Walk the directory tree up to the root, checking for any change in st_dev
		// If a change is found, the previous value of path is the mount point itself
		while (path != "/") {
			pos = path.findRev("/", -1, TRUE);
			if (pos < 0) {
				break;
			}
			path = path.mid(0, pos);
			if (path == "") {
				path = "/";
			}
			stat(path.local8Bit(), &directory_info);
			if (directory_info.st_dev != prevDev) {
				break;
			}
			prevPath = path;
			prevDev = directory_info.st_dev;
		}
	}

	// Read in mount table
	mountTable.clear();
	TQFile file( "/proc/mounts" );
	if ( file.open( IO_ReadOnly ) ) {
		TQTextStream stream( &file );
		while ( !stream.atEnd() ) {
			mountTable.append(stream.readLine());
		}
		file.close();
	}

	// Parse mount table
	TQStringList::Iterator it;
	for ( it = mountTable.begin(); it != mountTable.end(); ++it ) {
		TQStringList mountInfo = TQStringList::split(" ", (*it), true);
		if ((*mountInfo.at(1)) == prevPath) {
			return (*mountInfo.at(2));
		}
	}

	// Unknown file system type
	return TQString::null;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:52,代码来源:tdestoragedevice.cpp

示例12: suggest

TQStringList HSpellDict::suggest( const TQString& word )
{
    TQStringList qsug;
    struct corlist cl;
    int n_sugg;
    corlist_init( &cl );
    hspell_trycorrect( m_speller, codec->fromUnicode( word ), &cl );
    for( n_sugg = 0; n_sugg < corlist_n( &cl ); n_sugg++){
	    qsug.append( codec->toUnicode( corlist_str( &cl, n_sugg) ) );
    }
    corlist_free( &cl );
    return qsug;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:13,代码来源:tdespell_hspelldict.cpp

示例13: save_pattern

//*******************************************************
//             Static utility functions
//*******************************************************
static void save_pattern(TQComboBox *obj,
			 const TQString & group, const TQString & entry)
{
  // TQComboBox allows insertion of items more than specified by
  // maxCount() (QT bug?). This API call will truncate list if needed.
  obj->setMaxCount(15);

  // make sure the current item is saved first so it will be the
  // default when started next time
  TQStringList sl;
  TQString cur = obj->currentText();
  sl.append(cur);
  for (int i = 0; i < obj->count(); i++) {
    if( cur != obj->text(i) ) {
      sl.append(obj->text(i));
    }
  }

  TDEConfig *conf = TDEGlobal::config();
  conf->setGroup(group);
  conf->writePathEntry(entry, sl);
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:25,代码来源:kftabdlg.cpp

示例14: addDir

void ZipArch::addDir( const TQString & _dirName )
{
  if ( !_dirName.isEmpty() )
  {
    bool bOldRecVal = ArkSettings::rarRecurseSubdirs();
    // must be true for add directory - otherwise why would user try?
    ArkSettings::setRarRecurseSubdirs( true );

    TQStringList list;
    list.append( _dirName );
    addFile( list );
    ArkSettings::setRarRecurseSubdirs( bOldRecVal ); // reset to old val
  }
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:14,代码来源:zip.cpp

示例15: availableKeys

TQStringList FileProps::availableKeys( const TQString& group ) const
{
    KFileMetaInfoGroup g = m_info->group( group );
    TQStringList allKeys = g.keys();
    TQStringList ret;
    TQStringList::ConstIterator it = allKeys.begin();
    for ( ; it != allKeys.end(); ++it )
    {
        if ( g.item( *it ).isValid() )
            ret.append( *it );
    }

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


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