本文整理汇总了C++中TDEConfig::readPathListEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ TDEConfig::readPathListEntry方法的具体用法?C++ TDEConfig::readPathListEntry怎么用?C++ TDEConfig::readPathListEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDEConfig
的用法示例。
在下文中一共展示了TDEConfig::readPathListEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setURL
void KfindTabWidget::setURL( const KURL & url )
{
TDEConfig *conf = TDEGlobal::config();
conf->setGroup("History");
m_url = url;
TQStringList sl = conf->readPathListEntry("Directories");
dirBox->clear(); // make sure there is no old Stuff in there
if(!sl.isEmpty()) {
dirBox->insertStringList(sl);
// If the _searchPath already exists in the list we do not
// want to add it again
int indx = sl.findIndex(m_url.prettyURL());
if(indx == -1)
dirBox->insertItem(m_url.prettyURL(), 0); // make it the first one
else
dirBox->setCurrentItem(indx);
}
else {
TQDir m_dir("/lib");
dirBox ->insertItem( m_url.prettyURL() );
dirBox ->insertItem( "file:" + TQDir::homeDirPath() );
dirBox ->insertItem( "file:/" );
dirBox ->insertItem( "file:/usr" );
if (m_dir.exists())
dirBox ->insertItem( "file:/lib" );
dirBox ->insertItem( "file:/home" );
dirBox ->insertItem( "file:/etc" );
dirBox ->insertItem( "file:/var" );
dirBox ->insertItem( "file:/mnt" );
}
}
示例2: loadHistory
void KfindTabWidget::loadHistory()
{
// Load pattern history
TDEConfig *conf = TDEGlobal::config();
conf->setGroup("History");
TQStringList sl = conf->readListEntry("Patterns");
if(!sl.isEmpty())
nameBox->insertStringList(sl);
else
nameBox->insertItem("*");
sl = conf->readPathListEntry("Directories");
if(!sl.isEmpty()) {
dirBox->insertStringList(sl);
// If the _searchPath already exists in the list we do not
// want to add it again
int indx = sl.findIndex(m_url.prettyURL());
if(indx == -1)
dirBox->insertItem(m_url.prettyURL(), 0); // make it the first one
else
dirBox->setCurrentItem(indx);
}
else {
TQDir m_dir("/lib");
dirBox ->insertItem( m_url.prettyURL() );
dirBox ->insertItem( "file:" + TQDir::homeDirPath() );
dirBox ->insertItem( "file:/" );
dirBox ->insertItem( "file:/usr" );
if (m_dir.exists())
dirBox ->insertItem( "file:/lib" );
dirBox ->insertItem( "file:/home" );
dirBox ->insertItem( "file:/etc" );
dirBox ->insertItem( "file:/var" );
dirBox ->insertItem( "file:/mnt" );
}
}