本文整理汇总了C++中TDEConfig::readListEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ TDEConfig::readListEntry方法的具体用法?C++ TDEConfig::readListEntry怎么用?C++ TDEConfig::readListEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDEConfig
的用法示例。
在下文中一共展示了TDEConfig::readListEntry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void KFSConfigPage::init()
{
TDEConfig *config = kapp->config();
config->setGroup( "fileselector" );
// toolbar
TQStringList l = config->readListEntry( "toolbar actions", ',' );
if ( l.isEmpty() ) // default toolbar
l << "up" << "back" << "forward" << "home" <<
"short view" << "detailed view" <<
"bookmarks" << "sync_dir";
// actions from diroperator + two of our own
TQStringList allActions;
allActions << "up" << "back" << "forward" << "home" <<
"reload" << "mkdir" << "delete" <<
"short view" << "detailed view" /*<< "view menu" <<
"show hidden" << "properties"*/ <<
"bookmarks" << "sync_dir";
TQRegExp re("&(?=[^&])");
TDEAction *ac;
TQListBox *lb;
for ( TQStringList::Iterator it=allActions.begin(); it != allActions.end(); ++it ) {
lb = l.contains( *it ) ? acSel->selectedListBox() : acSel->availableListBox();
if ( *it == "bookmarks" || *it == "sync_dir" )
ac = fileSelector->actionCollection()->action( (*it).latin1() );
else
ac = fileSelector->dirOperator()->actionCollection()->action( (*it).latin1() );
if ( ac )
new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().replace( re, "" ), *it );
}
// sync
int s = fileSelector->autoSyncEvents;
cbSyncActive->setChecked( s & KateFileSelector::DocumentChanged );
cbSyncShow->setChecked( s & KateFileSelector::GotVisible );
// histories
sbPathHistLength->setValue( fileSelector->cmbPath->maxItems() );
sbFilterHistLength->setValue( fileSelector->filter->maxCount() );
// session
cbSesLocation->setChecked( config->readBoolEntry( "restore location", true ) );
cbSesFilter->setChecked( config->readBoolEntry( "restore last filter", true ) );
}
示例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" );
}
}
示例3: initialize
void ExtensionManager::initialize()
{
m_loadingContainers = true;
// kdDebug(1210) << "ExtensionManager::loadContainerConfig()" << endl;
TDEConfig* config = TDEGlobal::config();
PluginManager* pm = PluginManager::the();
// set up the "main" panel
if (config->hasGroup("Main Panel"))
{
config->setGroup("Main Panel");
if (config->hasKey("DesktopFile"))
{
m_mainPanel = pm->createExtensionContainer(config->readPathEntry("DesktopFile"),
true, config->readPathEntry("ConfigFile"),
"Main Panel");
}
}
if (!m_mainPanel)
{
// fall back to a regular ol' PanelExtension
m_mainPanel = pm->createExtensionContainer(
"childpanelextension.desktop",
true,
TQString(kapp->aboutData()->appName()) + "rc",
"Main Panel");
}
if (!m_mainPanel)
{
KMessageBox::error(0, i18n("The TDE panel (kicker) could not load the main panel "
"due to a problem with your installation. "),
i18n("Fatal Error!"));
exit(1);
}
configureMenubar(true);
Kicker::the()->setMainWidget(m_mainPanel);
m_mainPanel->readConfig();
m_mainPanel->show();
kapp->processEvents();
// read extension list
config->setGroup("General");
TQStringList elist = config->readListEntry("Extensions2");
// now restore the extensions
TQStringList::iterator itEnd = elist.end();
for (TQStringList::iterator it = elist.begin(); it != elist.end(); ++it)
{
// last container?
TQStringList::iterator lastcheck(it);
lastcheck++;
if (lastcheck == elist.end()) {
m_loadingContainers = false;
}
// extension id
TQString extensionId(*it);
// create a matching applet container
if (extensionId.find("Extension") == -1)
{
continue;
}
// is there a config group for this extension?
if (!config->hasGroup(extensionId))
{
continue;
}
// set config group
config->setGroup(extensionId);
ExtensionContainer* e = pm->createExtensionContainer(config->readPathEntry("DesktopFile"),
true, // is startup
config->readPathEntry("ConfigFile"),
extensionId);
if (e)
{
addContainer(e);
e->readConfig();
e->show();
kapp->processEvents();
}
}
m_loadingContainers = false;
pm->clearUntrustedLists();
connect(Kicker::the(), TQT_SIGNAL(configurationChanged()), TQT_SLOT(configurationChanged()));
DCOPRef r( "ksmserver", "ksmserver" );
r.send( "resumeStartup", TQCString( "kicker" ));
}
示例4: migrateMenubar
void ExtensionManager::migrateMenubar()
{
// lame, lame, lame.
// the menubar applet was just plunked into kicker and not much
// thought was put into how it should be used. great idea, but no
// integration. >:-(
// so now we have to check to see if we HAVE another extension that
// will have a menubar in it, and if so, abort creating one of our
// own.
//
// the reason i didn't do this as a tdeconfig_update script is that
// most people don't use this feature, so no reason to penalize
// everyone, and moreover the user may added this to their main
// panel, meaning kickerrc itself would have to be vastly modified
// with lots of complications. not work it IMHO.
TDEConfig* config = TDEGlobal::config();
config->setGroup("General");
if (config->readBoolEntry("CheckedForMenubar", false))
{
return;
}
if (!locate("config", "kicker_menubarpanelrc").isEmpty())
{
// don't overwrite/override something that's already there
return;
}
TQStringList elist = config->readListEntry("Extensions2");
TQStringList::iterator itEnd = elist.end();
for (TQStringList::iterator it = elist.begin(); it != elist.end(); ++it)
{
TQString extensionId(*it);
if (extensionId.find("Extension") == -1)
{
continue;
}
// is there a config group for this extension?
if (!config->hasGroup(extensionId))
{
continue;
}
config->setGroup(extensionId);
TQString extension = config->readPathEntry("ConfigFile");
TDEConfig extensionConfig(locate("config", extension));
extensionConfig.setGroup("General");
if (extensionConfig.hasKey("Applets2"))
{
TQStringList containers = extensionConfig.readListEntry("Applets2");
TQStringList::iterator cit = containers.begin();
TQStringList::iterator citEnd = containers.end();
for (; cit != citEnd; ++cit)
{
TQString appletId(*cit);
// is there a config group for this applet?
if (!extensionConfig.hasGroup(appletId))
{
continue;
}
TDEConfigGroup group(&extensionConfig, appletId.latin1());
TQString appletType = appletId.left(appletId.findRev('_'));
if (appletType == "Applet")
{
TQString appletFile = group.readPathEntry("DesktopFile");
if (appletFile.find("menuapplet.desktop") != -1)
{
TQString menubarConfig = locate("config", extension);
TDEIO::NetAccess::copy(menubarConfig,
locateLocal("config",
"kicker_menubarpanelrc"), 0);
elist.remove(it);
config->setGroup("General");
config->writeEntry("Extensions2", elist);
config->writeEntry("CheckedForMenubar", true);
config->sync();
return;
}
}
}
}
}
config->setGroup("General");
config->writeEntry("CheckedForMenubar", true);
}
示例5: aboutData
//.........这里部分代码省略.........
if (a->isRestored() || !profile.isEmpty())
{
if (!shell)
shell = konsole_shell(eargs);
if (profile.isEmpty())
sessionconfig = a->sessionConfig();
sessionconfig->setDesktopGroup();
int n = 1;
TQString key;
TQString sTitle;
TQString sPgm;
TQString sTerm;
TQString sIcon;
TQString sCwd;
int n_tabbar;
// TODO: Session management stores everything in same group,
// should use one group / mainwindow
while (TDEMainWindow::canBeRestored(n) || !profile.isEmpty())
{
sessionconfig->setGroup(TQString("%1").arg(n));
if (!sessionconfig->hasKey("Pgm0"))
sessionconfig->setDesktopGroup(); // Backwards compatible
int session_count = sessionconfig->readNumEntry("numSes");
int counter = 0;
wname = sessionconfig->readEntry("class",wname).latin1();
sPgm = sessionconfig->readEntry("Pgm0", shell);
sessionconfig->readListEntry("Args0", eargs);
sTitle = sessionconfig->readEntry("Title0", title);
sTerm = sessionconfig->readEntry("Term0");
sIcon = sessionconfig->readEntry("Icon0","konsole");
sCwd = sessionconfig->readPathEntry("Cwd0");
workDir = sessionconfig->readPathEntry("workdir");
n_tabbar = TQMIN(sessionconfig->readUnsignedNumEntry("tabbar",Konsole::TabBottom),2);
Konsole *m = new Konsole(wname,histon,menubaron,tabbaron,frameon,scrollbaron,0/*type*/,true,n_tabbar, workDir);
m->newSession(sPgm, eargs, sTerm, sIcon, sTitle, sCwd);
m->enableFullScripting(full_script);
m->enableFixedSize(fixed_size);
m->restore(n);
sessionconfig->setGroup(TQString("%1").arg(n));
if (!sessionconfig->hasKey("Pgm0"))
sessionconfig->setDesktopGroup(); // Backwards compatible
m->makeGUI();
m->setEncoding(sessionconfig->readNumEntry("Encoding0"));
m->setSchema(sessionconfig->readEntry("Schema0"));
// Use konsolerc default as tmpFont instead?
TQFont tmpFont = TDEGlobalSettings::fixedFont();
m->initSessionFont(sessionconfig->readFontEntry("SessionFont0", &tmpFont));
m->initSessionKeyTab(sessionconfig->readEntry("KeyTab0"));
m->initMonitorActivity(sessionconfig->readBoolEntry("MonitorActivity0",false));
m->initMonitorSilence(sessionconfig->readBoolEntry("MonitorSilence0",false));
m->initMasterMode(sessionconfig->readBoolEntry("MasterMode0",false));
m->initTabColor(sessionconfig->readColorEntry("TabColor0"));
// -1 will be changed to the default history in konsolerc
m->initHistory(sessionconfig->readNumEntry("History0", -1),
sessionconfig->readBoolEntry("HistoryEnabled0", true));
counter++;